mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
VM: allow ptr setting ptr fields (#12825)
This commit is contained in:
committed by
Andreas Rumpf
parent
7213969901
commit
23fc93fc2d
@@ -231,7 +231,11 @@ proc fastAsgnComplex(x: var TFullReg, y: TFullReg) =
|
||||
proc writeField(n: var PNode, x: TFullReg) =
|
||||
case x.kind
|
||||
of rkNone: discard
|
||||
of rkInt: n.intVal = x.intVal
|
||||
of rkInt:
|
||||
if n.kind == nkNilLit:
|
||||
n[].reset
|
||||
n.kind = nkIntLit # ideally, `nkPtrLit`
|
||||
n.intVal = x.intVal
|
||||
of rkFloat: n.floatVal = x.floatVal
|
||||
of rkNode: n = copyValue(x.node)
|
||||
of rkRegisterAddr: writeField(n, x.regAddr[])
|
||||
|
||||
Reference in New Issue
Block a user