diff options
| author | taitep <taitep@taitep.se> | 2025-12-24 16:14:54 +0100 |
|---|---|---|
| committer | taitep <taitep@taitep.se> | 2025-12-24 16:14:54 +0100 |
| commit | 6d9efb7eb85af929f3d6c22111933bb58d1ea07e (patch) | |
| tree | e14b7a78715a764591039fcb7f485184f1cd6e8c /src/core.rs | |
| parent | 44394b3d19f82471ed6a4753138616e1c756c05c (diff) | |
Small refactor in exception handling in core.rs
Diffstat (limited to 'src/core.rs')
| -rw-r--r-- | src/core.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/core.rs b/src/core.rs index 7e477c1..d5b254d 100644 --- a/src/core.rs +++ b/src/core.rs @@ -50,19 +50,17 @@ 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) => { - self.throw_exception(e); - eprintln!("instr: {:08x}", instr.0); - break; - } + if let Err(e) = find_and_exec(instr, self) { + self.throw_exception(e); + eprintln!("instr: {:08x}", instr.0); + break; } } } |
