interp: improve unknown opcode handling

This commit is contained in:
Kenneth Bell
2023-09-12 16:46:48 +01:00
committed by Ayke
parent 58fafaeb5c
commit adadbadec3
+4 -1
View File
@@ -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>"
}