summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/vm.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim
index 91fe3d209..344ad6610 100644
--- a/compiler/vm.nim
+++ b/compiler/vm.nim
@@ -401,6 +401,11 @@ template handleJmpBack() {.dirty.} =
       globalError(c.debug[pc], errTooManyIterations)
   dec(c.loopIterations)
 
+proc recSetFlagIsRef(arg: PNode) =
+  arg.flags.incl(nfIsRef)
+  for i in 0 ..< arg.safeLen:
+    arg.sons[i].recSetFlagIsRef
+  
 proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
   var pc = start
   var tos = tos
@@ -926,6 +931,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
         macroCall.add(newSymNode(prc))
         for i in 1 .. rc-1: macroCall.add(regs[rb+i].regToNode)
         let a = evalTemplate(macroCall, prc, genSymOwner)
+        a.recSetFlagIsRef
         ensureKind(rkNode)
         regs[ra].node = a
     of opcTJmp: