diff options
-rw-r--r-- | compiler/vm.nim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim index ea82a3155..5d4784281 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -522,7 +522,9 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg = decodeBC(rkNode) let shiftedRb = rb + ord(regs[ra].node.kind == nkObjConstr) let dest = regs[ra].node - if dest.sons[shiftedRb].kind == nkExprColonExpr: + if dest.kind == nkNilLit: + stackTrace(c, tos, pc, errNilAccess) + elif dest.sons[shiftedRb].kind == nkExprColonExpr: putIntoNode(dest.sons[shiftedRb].sons[1], regs[rc]) else: putIntoNode(dest.sons[shiftedRb], regs[rc]) |