From a11ae9248f473b234d542ac9dc861568a0046d3e Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 5 May 2014 23:29:46 +0200 Subject: [PATCH] fixes #1140 --- compiler/vm.nim | 3 ++- compiler/vmgen.nim | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/vm.nim b/compiler/vm.nim index 836f90967..218369fa1 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -127,7 +127,8 @@ proc createStrKeepNode(x: var TFullReg) = elif x.node.kind == nkNilLit: system.reset(x.node[]) x.node.kind = nkStrLit - elif x.node.kind notin {nkStrLit..nkTripleStrLit}: + elif x.node.kind notin {nkStrLit..nkTripleStrLit} or + nfAllConst in x.node.flags: # XXX this is hacky; tests/txmlgen triggers it: x.node = newNode(nkStrLit) # debug x.node diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index c5eb67025..ba1b33e77 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -331,6 +331,7 @@ proc canonValue*(n: PNode): PNode = proc rawGenLiteral(c: PCtx; n: PNode): int = result = c.constants.len assert(n.kind != nkCall) + n.flags.incl nfAllConst c.constants.add n.canonValue internalAssert result < 0x7fff