We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7213969 commit 23fc93fCopy full SHA for 23fc93f
compiler/vm.nim
@@ -231,7 +231,11 @@ proc fastAsgnComplex(x: var TFullReg, y: TFullReg) =
231
proc writeField(n: var PNode, x: TFullReg) =
232
case x.kind
233
of rkNone: discard
234
- of rkInt: n.intVal = x.intVal
+ of rkInt:
235
+ if n.kind == nkNilLit:
236
+ n[].reset
237
+ n.kind = nkIntLit # ideally, `nkPtrLit`
238
+ n.intVal = x.intVal
239
of rkFloat: n.floatVal = x.floatVal
240
of rkNode: n = copyValue(x.node)
241
of rkRegisterAddr: writeField(n, x.regAddr[])
0 commit comments