diff options
author | Damian Gryski <[email protected]> | 2022-03-14 14:22:28 -0700 |
---|---|---|
committer | Ron Evans <[email protected]> | 2022-03-17 20:06:59 +0100 |
commit | 06b19cde2d39c85eb208e26fb223ecea138cbd67 (patch) | |
tree | 857995331e8eebebb654c1d3957819d8a54e0b30 /interp/interpreter.go | |
parent | 42ae9a665fb171b4e19c55250449801982041e6d (diff) | |
download | tinygo-06b19cde2d39c85eb208e26fb223ecea138cbd67.tar.gz tinygo-06b19cde2d39c85eb208e26fb223ecea138cbd67.zip |
interp: prevent an off-by-one during interp debug
Diffstat (limited to 'interp/interpreter.go')
-rw-r--r-- | interp/interpreter.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/interp/interpreter.go b/interp/interpreter.go index 8653b6297..1044a2c50 100644 --- a/interp/interpreter.go +++ b/interp/interpreter.go @@ -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, // possibly trying to recover from it if it failed to execute. if r.debug { - argStrings := make([]string, len(operands)) - for i := range argStrings { - argStrings[i] = operands[i+1].String() + argStrings := make([]string, len(operands)-1) + for i, v := range operands[1:] { + argStrings[i] = v.String() } fmt.Fprintln(os.Stderr, indent+"call:", callFn.name+"("+strings.Join(argStrings, ", ")+")") } |