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