make destructors more robust against unchecked arrays

This commit is contained in:
Andreas Rumpf 2017-10-18 17:05:33 +02:00
commit 9911d375b3

View file

@ -203,7 +203,7 @@ proc liftBodyAux(c: var TLiftCtx; t: PType; body, x, y: PNode) =
tyPtr, tyString, tyRef, tyOpt: tyPtr, tyString, tyRef, tyOpt:
defaultOp(c, t, body, x, y) defaultOp(c, t, body, x, y)
of tyArray, tySequence: of tyArray, tySequence:
if tfHasAsgn in t.flags: if {tfHasAsgn, tfUncheckedArray} * t.flags == {tfHasAsgn}:
if t.kind == tySequence: if t.kind == tySequence:
# XXX add 'nil' handling here # XXX add 'nil' handling here
body.add newSeqCall(c.c, x, y) body.add newSeqCall(c.c, x, y)