add comment

This commit is contained in:
Andrii Riabushenko
2018-12-05 21:45:01 +00:00
parent 972707440a
commit 268461f06e

View File

@@ -620,7 +620,8 @@ proc p(n: PNode; c: var Con): PNode =
of nkAsgn, nkFastAsgn:
if hasDestructor(n[0].typ):
result = moveOrCopy(n[0], n[1], c)
c.enableDestructor(n[0].sym)
c.enableDestructor(n[0].sym) # last read to sink argument could have disabled the destructor
# but the variable is assigned again and new value should be destroyed
else:
result = copyNode(n)
recurse(n, result)