Skip to content

Commit

Permalink
fix in opcCastIntToPtr (fixes flyx/NimYAML#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Nov 25, 2020
1 parent 932a4f5 commit 4b7f639
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compiler/vm.nim
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,11 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
let rb = instr.regB
let typ = regs[ra].node.typ
if typ.kind == tyRef:
regs[ra].node = cast[PNode](regs[rb].intVal)
template fn(val) = regs[ra].node = cast[PNode](val.intVal)
case regs[rb].kind
of rkInt: fn(regs[rb])
of rkNode: fn(regs[rb].node)
else: stackTrace(c, tos, pc, "regs[rb].kind: " & $regs[rb].kind)
else:
let node2 = newNodeIT(nkIntLit, c.debug[pc], typ)
case regs[rb].kind
Expand Down

0 comments on commit 4b7f639

Please sign in to comment.