fixes #10104
This commit is contained in:
parent
d740a5b79a
commit
0c10fc67eb
1 changed files with 12 additions and 6 deletions
|
|
@ -85,7 +85,7 @@ proc stackTraceAux(c: PCtx; x: PStackFrame; pc: int; recursionLimit=100) =
|
||||||
add(s, x.prc.name.s)
|
add(s, x.prc.name.s)
|
||||||
msgWriteln(c.config, s)
|
msgWriteln(c.config, s)
|
||||||
|
|
||||||
proc stackTrace(c: PCtx, tos: PStackFrame, pc: int,
|
proc stackTraceImpl(c: PCtx, tos: PStackFrame, pc: int,
|
||||||
msg: string, lineInfo: TLineInfo) =
|
msg: string, lineInfo: TLineInfo) =
|
||||||
msgWriteln(c.config, "stack trace: (most recent call last)")
|
msgWriteln(c.config, "stack trace: (most recent call last)")
|
||||||
stackTraceAux(c, tos, pc)
|
stackTraceAux(c, tos, pc)
|
||||||
|
|
@ -93,8 +93,14 @@ proc stackTrace(c: PCtx, tos: PStackFrame, pc: int,
|
||||||
if c.mode == emRepl: globalError(c.config, lineInfo, msg)
|
if c.mode == emRepl: globalError(c.config, lineInfo, msg)
|
||||||
else: localError(c.config, lineInfo, msg)
|
else: localError(c.config, lineInfo, msg)
|
||||||
|
|
||||||
proc stackTrace(c: PCtx, tos: PStackFrame, pc: int, msg: string) =
|
template stackTrace(c: PCtx, tos: PStackFrame, pc: int,
|
||||||
stackTrace(c, tos, pc, msg, c.debug[pc])
|
msg: string, lineInfo: TLineInfo) =
|
||||||
|
stackTraceImpl(c, tos, pc, msg, lineInfo)
|
||||||
|
return
|
||||||
|
|
||||||
|
template stackTrace(c: PCtx, tos: PStackFrame, pc: int, msg: string) =
|
||||||
|
stackTraceImpl(c, tos, pc, msg, c.debug[pc])
|
||||||
|
return
|
||||||
|
|
||||||
proc bailOut(c: PCtx; tos: PStackFrame) =
|
proc bailOut(c: PCtx; tos: PStackFrame) =
|
||||||
stackTrace(c, tos, c.exceptionInstr, "unhandled exception: " &
|
stackTrace(c, tos, c.exceptionInstr, "unhandled exception: " &
|
||||||
|
|
@ -955,13 +961,13 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||||
decodeBC(rkInt)
|
decodeBC(rkInt)
|
||||||
let a = regs[rb].node
|
let a = regs[rb].node
|
||||||
let b = regs[rc].node
|
let b = regs[rc].node
|
||||||
if a.kind == nkSym and a.sym.kind in skProcKinds and
|
if a.kind == nkSym and a.sym.kind in skProcKinds and
|
||||||
b.kind == nkSym and b.sym.kind in skProcKinds:
|
b.kind == nkSym and b.sym.kind in skProcKinds:
|
||||||
regs[ra].intVal =
|
regs[ra].intVal =
|
||||||
if sfFromGeneric in a.sym.flags and a.sym.owner == b.sym: 1
|
if sfFromGeneric in a.sym.flags and a.sym.owner == b.sym: 1
|
||||||
else: 0
|
else: 0
|
||||||
else:
|
else:
|
||||||
stackTrace(c, tos, pc, "node is not a proc symbol")
|
stackTrace(c, tos, pc, "node is not a proc symbol")
|
||||||
of opcEcho:
|
of opcEcho:
|
||||||
let rb = instr.regB
|
let rb = instr.regB
|
||||||
if rb == 1:
|
if rb == 1:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue