diff options
-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 |