summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-12-16 20:12:56 +0100
committerAraq <rumpf_a@web.de>2012-12-16 20:12:56 +0100
commitd16c04d8f8fe8d61016e99c6fcccc45fff66d075 (patch)
tree46992061da7c91eccb10f74793d96d491a1e9f2f /compiler
parent61a43979e6cf8a5f7925a001a56075be232628dc (diff)
downloadNim-d16c04d8f8fe8d61016e99c6fcccc45fff66d075.tar.gz
don't invoke destructors for .global. variables
Diffstat (limited to 'compiler')
-rwxr-xr-xcompiler/semstmts.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 712a6d2af..abd064a62 100755
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -1078,7 +1078,8 @@ proc insertDestructors(c: PContext, varSection: PNode):
       varTyp = varId.sym.typ
       info = varId.info
 
-    if varTyp != nil and instantiateDestructor(c, varTyp):
+    if varTyp != nil and instantiateDestructor(c, varTyp) and 
+        sfGlobal notin varId.sym.flags:
       var tryStmt = newNodeI(nkTryStmt, info)
 
       if j < totalVars - 1: