mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-17 22:41:14 +00:00
VM fix for refs
This commit is contained in:
committed by
Andreas Rumpf
parent
6758fbd06e
commit
7cf87dfac6
@@ -210,8 +210,14 @@ proc putIntoNode(n: var PNode; x: TFullReg) =
|
||||
of rkInt: n.intVal = x.intVal
|
||||
of rkFloat: n.floatVal = x.floatVal
|
||||
of rkNode:
|
||||
if nfIsRef in x.node.flags: n = x.node
|
||||
else: n[] = x.node[]
|
||||
if nfIsRef in x.node.flags:
|
||||
n = x.node
|
||||
else:
|
||||
let destIsRef = nfIsRef in n.flags
|
||||
n[] = x.node[]
|
||||
# Ref-ness must be kept for the destination
|
||||
if destIsRef:
|
||||
n.flags.incl nfIsRef
|
||||
of rkRegisterAddr: putIntoNode(n, x.regAddr[])
|
||||
of rkNodeAddr: n[] = x.nodeAddr[][]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user