diff options
author | Araq <rumpf_a@web.de> | 2012-12-16 20:12:56 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-12-16 20:12:56 +0100 |
commit | d16c04d8f8fe8d61016e99c6fcccc45fff66d075 (patch) | |
tree | 46992061da7c91eccb10f74793d96d491a1e9f2f /compiler | |
parent | 61a43979e6cf8a5f7925a001a56075be232628dc (diff) | |
download | Nim-d16c04d8f8fe8d61016e99c6fcccc45fff66d075.tar.gz |
don't invoke destructors for .global. variables
Diffstat (limited to 'compiler')
-rwxr-xr-x | compiler/semstmts.nim | 3 |
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: |