diff options
author | Araq <rumpf_a@web.de> | 2014-02-06 02:41:53 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-02-06 02:41:53 +0100 |
commit | 3be07d842a13cde69aeb5e7908ed62907daef4f7 (patch) | |
tree | adcd1cc8c57777704ef3625ac2534dbeb7a51dfd /compiler/vm.nim | |
parent | cc0a32ae87469fe30c8c81461cc8c7170f92c8cf (diff) | |
download | Nim-3be07d842a13cde69aeb5e7908ed62907daef4f7.tar.gz |
fixes regression: constant fac4 didn't work
Diffstat (limited to 'compiler/vm.nim')
-rw-r--r-- | compiler/vm.nim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim index 61881a897..10ac7aaaf 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -14,7 +14,7 @@ import ast except getstr import strutils, astalgo, msgs, vmdef, vmgen, nimsets, types, passes, unsigned, - parser, vmdeps, idents, trees, renderer, options + parser, vmdeps, idents, trees, renderer, options, transf from semfold import leValueConv, ordinalValToString from evaltempl import evalTemplate @@ -1078,6 +1078,7 @@ proc execute(c: PCtx, start: int): PNode = result = rawExecute(c, start, tos) proc evalStmt*(c: PCtx, n: PNode) = + let n = transformExpr(c.module, n) let start = genStmt(c, n) # execute new instructions; this redundant opcEof check saves us lots # of allocations in 'execute': @@ -1085,6 +1086,7 @@ proc evalStmt*(c: PCtx, n: PNode) = discard execute(c, start) proc evalExpr*(c: PCtx, n: PNode): PNode = + let n = transformExpr(c.module, n) let start = genExpr(c, n) assert c.code[start].opcode != opcEof result = execute(c, start) @@ -1127,6 +1129,7 @@ proc myProcess(c: PPassContext, n: PNode): PNode = const evalPass* = makePass(myOpen, nil, myProcess, myProcess) proc evalConstExprAux(module, prc: PSym, n: PNode, mode: TEvalMode): PNode = + let n = transformExpr(module, n) setupGlobalCtx(module) var c = globalCtx c.mode = mode |