summary refs log tree commit diff stats
path: root/compiler/vmgen.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-08-15 09:57:03 +0200
committerAraq <rumpf_a@web.de>2014-08-15 09:57:03 +0200
commitae681be62918ea1e766b230e2d098177794469e9 (patch)
treed5059ffa36875eacdd01620dcdbbe8db28729ad1 /compiler/vmgen.nim
parentf70b35b3b7837028296bcb06120fc293d11c613c (diff)
downloadNim-ae681be62918ea1e766b230e2d098177794469e9.tar.gz
fixes #1343
Diffstat (limited to 'compiler/vmgen.nim')
-rw-r--r--compiler/vmgen.nim7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim
index adbca8cca..94afbf008 100644
--- a/compiler/vmgen.nim
+++ b/compiler/vmgen.nim
@@ -1118,10 +1118,9 @@ proc checkCanEval(c: PCtx; n: PNode) =
   # we need to ensure that we don't evaluate 'x' here:
   # proc foo() = var x ...
   let s = n.sym
-  if s.position == 0:
-    if s.kind in {skVar, skTemp, skLet, skParam, skResult} and 
-        not s.isOwnedBy(c.prc.sym) and s.owner != c.module:
-      cannotEval(n)
+  if s.kind in {skVar, skTemp, skLet, skParam, skResult} and 
+      not s.isOwnedBy(c.prc.sym) and s.owner != c.module:
+    cannotEval(n)
 
 proc isTemp(c: PCtx; dest: TDest): bool =
   result = dest >= 0 and c.prc.slots[dest].kind >= slotTempUnknown