Add sym owner to macros (#8253)

This commit is contained in:
cooldome 2018-09-03 12:25:59 +01:00 • committed by Andreas Rumpf
commit e63c66b810
7 changed files with 50 additions and 3 deletions

View file

@ -920,6 +920,15 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
regs[ra].node.flags.incl nfIsRef
else:
stackTrace(c, tos, pc, "node is not a symbol")
of opcSymOwner:
decodeB(rkNode)
let a = regs[rb].node
if a.kind == nkSym:
regs[ra].node = if a.sym.owner.isNil: newNode(nkNilLit)
else: newSymNode(a.sym.skipGenericOwner)
regs[ra].node.flags.incl nfIsRef
else:
stackTrace(c, tos, pc, "node is not a symbol")
of opcEcho:
let rb = instr.regB
if rb == 1: