diff options
author | Araq <rumpf_a@web.de> | 2011-04-05 01:45:28 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-04-05 01:45:28 +0200 |
commit | 997e7d1e5b50597489360222bc16ccf1880875a2 (patch) | |
tree | ad8bf66b5159cebf6ae193c6fe1c2b584b3227f5 | |
parent | ecb3590102a6ee5a77d52075e136337c9ec6c4c5 (diff) | |
download | Nim-997e7d1e5b50597489360222bc16ccf1880875a2.tar.gz |
bugfix: tmacros1.nim works
-rwxr-xr-x | rod/evals.nim | 3 | ||||
-rwxr-xr-x | tests/accept/run/tmacros1.nim | 2 |
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 |