diff options
author | Araq <rumpf_a@web.de> | 2014-08-14 02:42:26 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-08-14 02:42:26 +0200 |
commit | 2728bbccc4888ddc90adbdf469891935407b80af (patch) | |
tree | 450717e4fe08c97e5a45a81262f1b88441ebf406 /compiler | |
parent | 27b9d10570078c35a5d1b59010ccc6c1a3927f04 (diff) | |
download | Nim-2728bbccc4888ddc90adbdf469891935407b80af.tar.gz |
fixes newly introduced bugs
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ccgstmts.nim | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index f32ff3c78..eca026e12 100644 --- a/compiler/ccgstmts.nim +++ b/compiler/ccgstmts.nim @@ -1,7 +1,7 @@ # # # The Nimrod Compiler -# (c) Copyright 2013 Andreas Rumpf +# (c) Copyright 2014 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -160,7 +160,6 @@ proc genSingleVar(p: BProc, a: PNode) = var v = a.sons[0].sym if sfCompileTime in v.flags: return var targetProc = p - var immediateAsgn = isAssignedImmediately(a.sons[2]) if sfGlobal in v.flags: if sfPure in v.flags: # v.owner.kind != skModule: @@ -180,14 +179,14 @@ proc genSingleVar(p: BProc, a: PNode) = registerGcRoot(p, v) else: assignLocalVar(p, v) - initLocalVar(p, v, immediateAsgn) + initLocalVar(p, v, isAssignedImmediately(a.sons[2])) - if immediateAsgn: + if a.sons[2].kind != nkEmpty: genLineDir(targetProc, a) loadInto(targetProc, a.sons[0], a.sons[2], v.loc) proc genClosureVar(p: BProc, a: PNode) = - var immediateAsgn = isAssignedImmediately(a.sons[2]) + var immediateAsgn = a.sons[2].kind != nkEmpty if immediateAsgn: var v: TLoc initLocExpr(p, a.sons[0], v) |