summary refs log tree commit diff stats
path: root/compiler/vm.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-10-02 08:31:38 +0200
committerAndreas Rumpf <rumpf_a@web.de>2017-10-02 08:31:38 +0200
commite9243a16167b24899d4fcf051f3252b3a5804811 (patch)
treedc4733a6f178d4f04ee4da33c50ca807eb7e9dd0 /compiler/vm.nim
parentfc7961d4ccd31ab6e7eabbeb7aa22b5488924b4f (diff)
parent02ff5f596c330b68927f843814ecb9b86c2eee67 (diff)
downloadNim-e9243a16167b24899d4fcf051f3252b3a5804811.tar.gz
Merge branch 'devel' into araq
Diffstat (limited to 'compiler/vm.nim')
-rw-r--r--compiler/vm.nim10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim
index 8d4359db9..08605cad1 100644
--- a/compiler/vm.nim
+++ b/compiler/vm.nim
@@ -19,7 +19,7 @@ import ast except getstr
 import
   strutils, astalgo, msgs, vmdef, vmgen, nimsets, types, passes,
   parser, vmdeps, idents, trees, renderer, options, transf, parseutils,
-  vmmarshal
+  vmmarshal, gorgeimpl
 
 from semfold import leValueConv, ordinalValToString
 from evaltempl import evalTemplate
@@ -66,7 +66,10 @@ proc stackTraceAux(c: PCtx; x: PStackFrame; pc: int; recursionLimit=100) =
     stackTraceAux(c, x.next, x.comesFrom, recursionLimit-1)
     var info = c.debug[pc]
     # we now use the same format as in system/except.nim
-    var s = toFilename(info)
+    var s = substr(toFilename(info), 0)
+    # this 'substr' prevents a strange corruption. XXX This needs to be
+    # investigated eventually but first attempts to fix it broke everything
+    # see the araq-wip-fixed-writebarrier branch.
     var line = toLinenumber(info)
     if line > 0:
       add(s, '(')
@@ -979,7 +982,8 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
           let node = regs[rb+i].regToNode
           node.info = c.debug[pc]
           macroCall.add(node)
-        let a = evalTemplate(macroCall, prc, genSymOwner)
+        var a = evalTemplate(macroCall, prc, genSymOwner)
+        if a.kind == nkStmtList and a.len == 1: a = a[0]
         a.recSetFlagIsRef
         ensureKind(rkNode)
         regs[ra].node = a