mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 15:33:40 +00:00
interp: prevent an off-by-one during interp debug
This commit is contained in:
@@ -492,9 +492,9 @@ func (r *runner) run(fn *function, params []value, parentMem *memoryView, indent
|
|||||||
// Call a function with a definition available. Run it as usual,
|
// Call a function with a definition available. Run it as usual,
|
||||||
// possibly trying to recover from it if it failed to execute.
|
// possibly trying to recover from it if it failed to execute.
|
||||||
if r.debug {
|
if r.debug {
|
||||||
argStrings := make([]string, len(operands))
|
argStrings := make([]string, len(operands)-1)
|
||||||
for i := range argStrings {
|
for i, v := range operands[1:] {
|
||||||
argStrings[i] = operands[i+1].String()
|
argStrings[i] = v.String()
|
||||||
}
|
}
|
||||||
fmt.Fprintln(os.Stderr, indent+"call:", callFn.name+"("+strings.Join(argStrings, ", ")+")")
|
fmt.Fprintln(os.Stderr, indent+"call:", callFn.name+"("+strings.Join(argStrings, ", ")+")")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user