Refactor stackTrace
in the vm
implementation
#160
Labels
good first issue
Easy-to-start-with issue with no in-depth knowledge or complex implementation required.
refactor
Implementation refactor
VM
rawExecute
uses an implicitly injectedreturn
statement that is added bytemplate stackTrace()
. This makes code much harder to read, since you can't properly see where the loop is terminated.template stackTrace( c: PCtx, tos: PStackFrame, pc: int, sem: ReportTypes, ) = stackTraceImpl(c, tos, pc, c.debug[pc], instLoc()) localReport(c.config, c.debug[pc], sem) - return
Remove implicitly injected
return
and add it in a way that is visible to the reader.of opcLdArr: # a = b[c] decodeBC(rkNode) if regs[rc].intVal > high(int): stackTrace(c, tos, pc, reportVmIdx(regs[rc].intVal, high(int))) + return
Hint: in order to track all the usages of the
stackTrace
template, you can add{.hint: "used here".}
or{.warning: "used here".}
The text was updated successfully, but these errors were encountered: