Reduce exception copying

This commit is contained in:
Andrew Morris
2023-07-01 09:21:47 +10:00
parent 7a7ba86921
commit 7ad17b73b6
12 changed files with 18 additions and 34 deletions

View File

@@ -612,18 +612,16 @@ impl StackFrameTrait for BytecodeStackFrame {
panic!("Not appropriate for BytecodeStackFrame")
}
fn catch_exception(&mut self, exception: Val) -> bool {
fn catch_exception(&mut self, exception: &mut Val) {
if let Some(catch_setting) = &self.catch_setting {
let exception = take(exception);
if let Some(r) = catch_setting.register {
self.registers[r] = exception;
}
self.decoder.pos = catch_setting.pos;
self.catch_setting = None;
true
} else {
false
}
}