summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/vm.nim1
-rw-r--r--tests/macros/ttryparseexpr.nim6
2 files changed, 5 insertions, 2 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim
index a15807b24..f75db56b8 100644
--- a/compiler/vm.nim
+++ b/compiler/vm.nim
@@ -1172,6 +1172,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
     of opcQueryErrorFlag:
       createStr regs[ra]
       regs[ra].node.strVal = c.errorFlag
+      c.errorFlag.setLen 0
     of opcCallSite:
       ensureKind(rkNode)
       if c.callsite != nil: regs[ra].node = c.callsite
diff --git a/tests/macros/ttryparseexpr.nim b/tests/macros/ttryparseexpr.nim
index 2a6f4437d..af932eb7d 100644
--- a/tests/macros/ttryparseexpr.nim
+++ b/tests/macros/ttryparseexpr.nim
@@ -1,5 +1,5 @@
 discard """
-  outputsub: '''Error: invalid indentation'''
+  outputsub: '''Error: invalid indentation 45'''
 """
 
 # feature request #1473
@@ -12,6 +12,8 @@ macro test(text: string): expr =
     result = newLit getCurrentExceptionMsg()
 
 const
+  valid = 45
   a = test("foo&&")
+  b = test("valid")
 
-echo a
+echo a, " ", b