summary refs log tree commit diff stats
path: root/compiler/sempass2.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/sempass2.nim')
-rw-r--r--compiler/sempass2.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim
index 00afb737d..411617acd 100644
--- a/compiler/sempass2.nim
+++ b/compiler/sempass2.nim
@@ -692,6 +692,8 @@ proc track(tracked: PEffects, n: PNode) =
   case n.kind
   of nkSym:
     useVar(tracked, n)
+    if n.sym.typ != nil and tfHasAsgn in n.sym.typ.flags:
+      tracked.owner.flags.incl sfInjectDestructors
   of nkRaiseStmt:
     if n[0].kind != nkEmpty:
       n.sons[0].info = n.info