Move wasMoved out of =destroy

This commit is contained in:
Clyybber 2020-07-08 20:48:17 +02:00 • committed by Andreas Rumpf
commit 4a1128d16c
5 changed files with 9 additions and 19 deletions

View file

@ -2100,14 +2100,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; $1.len = 0; }$n",
"}$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; $1.len = 0; }$n",
"}$n",
[rdLoc(a), getTypeDesc(p.module, t.lastSon)])
else: discard "nothing to do"
else: