interp: improve unknown opcode handling

Этот коммит содержится в:
Kenneth Bell 2023-09-12 16:46:48 +01:00 коммит произвёл Ayke
родитель 58fafaeb5c
коммит adadbadec3

Просмотреть файл

@ -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>"
}