diff options
author | Kenneth Bell <[email protected]> | 2023-09-12 16:46:48 +0100 |
---|---|---|
committer | Ayke <[email protected]> | 2023-09-21 01:18:05 +0200 |
commit | adadbadec30b59f857ce48d7de547c0315d53356 (patch) | |
tree | 25c74116be8000e02d89a743d7b7639a77c65af4 /interp | |
parent | 58fafaeb5ce3ae0cdf0399dab392d24c2322b435 (diff) | |
download | tinygo-adadbadec30b59f857ce48d7de547c0315d53356.tar.gz tinygo-adadbadec30b59f857ce48d7de547c0315d53356.zip |
interp: improve unknown opcode handling
Diffstat (limited to 'interp')
-rw-r--r-- | interp/compiler.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/interp/compiler.go b/interp/compiler.go index f0a096862..37faaae54 100644 --- a/interp/compiler.go +++ b/interp/compiler.go @@ -49,7 +49,10 @@ func (inst *instruction) String() string { operands[i] = op.String() } - name := instructionNameMap[inst.opcode] + name := "" + if int(inst.opcode) < len(instructionNameMap) { + name = instructionNameMap[inst.opcode] + } if name == "" { name = "<unknown op>" } |