diff options
author | Araq <rumpf_a@web.de> | 2020-03-03 23:03:33 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2020-03-03 23:03:33 +0100 |
commit | 8705ee7015382ac2957733dfef5e02a0831e7fb4 (patch) | |
tree | 0104b25e2f59ebadeffd5fa63ee442aefbf8dabb /compiler/ccgexprs.nim | |
parent | f8175688a3b9c88b53685a35a454aeba4b2bcc5d (diff) | |
download | Nim-8705ee7015382ac2957733dfef5e02a0831e7fb4.tar.gz |
ARC hotfix; proper destruction of seqs and strings after a move
Diffstat (limited to 'compiler/ccgexprs.nim')
-rw-r--r-- | compiler/ccgexprs.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 111e1053b..277913b17 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -2040,14 +2040,14 @@ proc genDestroy(p: BProc; n: PNode) = initLocExpr(p, arg, a) linefmt(p, cpsStmts, "if ($1.p && !($1.p->cap & NIM_STRLIT_FLAG)) {$n" & " #deallocShared($1.p);$n" & - " $1.p = NIM_NIL; }$n", + " $1.p = NIM_NIL; $1.len = 0; }$n", [rdLoc(a)]) of tySequence: var a: TLoc initLocExpr(p, arg, a) linefmt(p, cpsStmts, "if ($1.p && !($1.p->cap & NIM_STRLIT_FLAG)) {$n" & " #deallocShared($1.p);$n" & - " $1.p = NIM_NIL; }$n", + " $1.p = NIM_NIL; $1.len = 0; }$n", [rdLoc(a), getTypeDesc(p.module, t.lastSon)]) else: discard "nothing to do" else: |