summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-04-05 01:45:28 +0200
committerAraq <rumpf_a@web.de>2011-04-05 01:45:28 +0200
commit997e7d1e5b50597489360222bc16ccf1880875a2 (patch)
treead8bf66b5159cebf6ae193c6fe1c2b584b3227f5
parentecb3590102a6ee5a77d52075e136337c9ec6c4c5 (diff)
downloadNim-997e7d1e5b50597489360222bc16ccf1880875a2.tar.gz
bugfix: tmacros1.nim works
-rwxr-xr-xrod/evals.nim3
-rwxr-xr-xtests/accept/run/tmacros1.nim2
2 files changed, 3 insertions, 2 deletions
diff --git a/rod/evals.nim b/rod/evals.nim
index 31c0e629a..29f77aeda 100755
--- a/rod/evals.nim
+++ b/rod/evals.nim
@@ -303,7 +303,8 @@ proc evalVariable(c: PStackFrame, sym: PSym, flags: TEvalFlags): PNode =
       if result == nil: result = emptyNode
       return
     result = IdNodeTableGet(x.mapping, sym)
-    if not aliasNeeded(result, flags): result = copyTree(result)
+    if result != nil and not aliasNeeded(result, flags): 
+      result = copyTree(result)
     if result != nil: return 
     x = x.next
   result = emptyNode
diff --git a/tests/accept/run/tmacros1.nim b/tests/accept/run/tmacros1.nim
index 572ebb914..8cf2a5aa7 100755
--- a/tests/accept/run/tmacros1.nim
+++ b/tests/accept/run/tmacros1.nim
@@ -1,5 +1,5 @@
 discard """
-  output: "hellow"
+  output: "Got: 'nnkIntLit' hi"
 """
 
 import