From 1e11ff6b84b7a31ca55974d146233bfbc4cc5cf6 Mon Sep 17 00:00:00 2001 From: "Andrey R (cooldome)" Date: Tue, 17 Nov 2020 12:34:33 +0000 Subject: [PATCH] fix #15097 --- compiler/semstmts.nim | 3 ++- compiler/vm.nim | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 60778d25d6..1bb95edcff 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -2622,7 +2622,8 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind, proc determineType(c: PContext, s: PSym) = if s.typ != nil: return #if s.magic != mNone: return - #if s.ast.isNil: return + if s.ast.isNil: + globalError(c.config, s.info, errIllFormedAstX, "symbol of kind " & $s.kind) discard semProcAux(c, s.ast, s.kind, {}) proc semIterator(c: PContext, n: PNode): PNode = diff --git a/compiler/vm.nim b/compiler/vm.nim index f26d41324f..f4baa70385 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -2184,7 +2184,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg = else: regs[rc].node.strVal if k < 0 or k > ord(high(TSymKind)): internalError(c.config, c.debug[pc], "request to create symbol of invalid kind") - var sym = newSym(k.TSymKind, getIdent(c.cache, name), c.idgen, c.module.owner, c.debug[pc]) + var sym = newSym(k.TSymKind, getIdent(c.cache, name), c.idgen, c.module, c.debug[pc]) incl(sym.flags, sfGenSym) regs[ra].node = newSymNode(sym) regs[ra].node.flags.incl nfIsRef