diff --git a/compiler/vm.nim b/compiler/vm.nim index ea82a3155d..5d47842813 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])