ARC hotfix; proper destruction of seqs and strings after a move
This commit is contained in:
parent
f8175688a3
commit
8705ee7015
1 changed files with 2 additions and 2 deletions
|
|
@ -2040,14 +2040,14 @@ proc genDestroy(p: BProc; n: PNode) =
|
||||||
initLocExpr(p, arg, a)
|
initLocExpr(p, arg, a)
|
||||||
linefmt(p, cpsStmts, "if ($1.p && !($1.p->cap & NIM_STRLIT_FLAG)) {$n" &
|
linefmt(p, cpsStmts, "if ($1.p && !($1.p->cap & NIM_STRLIT_FLAG)) {$n" &
|
||||||
" #deallocShared($1.p);$n" &
|
" #deallocShared($1.p);$n" &
|
||||||
" $1.p = NIM_NIL; }$n",
|
" $1.p = NIM_NIL; $1.len = 0; }$n",
|
||||||
[rdLoc(a)])
|
[rdLoc(a)])
|
||||||
of tySequence:
|
of tySequence:
|
||||||
var a: TLoc
|
var a: TLoc
|
||||||
initLocExpr(p, arg, a)
|
initLocExpr(p, arg, a)
|
||||||
linefmt(p, cpsStmts, "if ($1.p && !($1.p->cap & NIM_STRLIT_FLAG)) {$n" &
|
linefmt(p, cpsStmts, "if ($1.p && !($1.p->cap & NIM_STRLIT_FLAG)) {$n" &
|
||||||
" #deallocShared($1.p);$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)])
|
[rdLoc(a), getTypeDesc(p.module, t.lastSon)])
|
||||||
else: discard "nothing to do"
|
else: discard "nothing to do"
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue