Small refactor in exception handling in core.rs
This commit is contained in:
@@ -50,22 +50,20 @@ impl Core {
|
||||
}
|
||||
|
||||
if instr & 3 != 3 {
|
||||
// Compressed instruction - (currently) unsupported
|
||||
self.throw_exception(ExceptionType::IllegalInstruction);
|
||||
break;
|
||||
}
|
||||
|
||||
let instr = Instruction(instr);
|
||||
|
||||
match find_and_exec(instr, self) {
|
||||
Ok(()) => {}
|
||||
Err(e) => {
|
||||
if let Err(e) = find_and_exec(instr, self) {
|
||||
self.throw_exception(e);
|
||||
eprintln!("instr: {:08x}", instr.0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn throw_exception(&mut self, exception_type: ExceptionType) {
|
||||
eprintln!("Exception: {exception_type:?}");
|
||||
|
||||
Reference in New Issue
Block a user