mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-09-08 21:59:06 +00:00
interp: improve unknown opcode handling
This commit is contained in:
+4
-1
@@ -49,7 +49,10 @@ func (inst *instruction) String() string {
|
|||||||
operands[i] = op.String()
|
operands[i] = op.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
name := instructionNameMap[inst.opcode]
|
name := ""
|
||||||
|
if int(inst.opcode) < len(instructionNameMap) {
|
||||||
|
name = instructionNameMap[inst.opcode]
|
||||||
|
}
|
||||||
if name == "" {
|
if name == "" {
|
||||||
name = "<unknown op>"
|
name = "<unknown op>"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user