mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-04-18 03:00:27 -04:00
Panic if catch_exception is called incorrectly
This commit is contained in:
@@ -714,16 +714,19 @@ impl StackFrameTrait for BytecodeStackFrame {
|
||||
}
|
||||
|
||||
fn catch_exception(&mut self, exception: &mut Val) {
|
||||
if let Some(catch_setting) = &self.catch_setting {
|
||||
let exception = take(exception);
|
||||
let catch_setting = self
|
||||
.catch_setting
|
||||
.as_ref()
|
||||
.expect("can_catch_exception should have been checked before calling this");
|
||||
|
||||
if let Some(r) = catch_setting.register {
|
||||
self.registers[r] = exception;
|
||||
}
|
||||
let exception = take(exception);
|
||||
|
||||
self.decoder.pos = catch_setting.pos;
|
||||
self.catch_setting = None;
|
||||
if let Some(r) = catch_setting.register {
|
||||
self.registers[r] = exception;
|
||||
}
|
||||
|
||||
self.decoder.pos = catch_setting.pos;
|
||||
self.catch_setting = None;
|
||||
}
|
||||
|
||||
fn clone_to_stack_frame(&self) -> StackFrame {
|
||||
|
||||
Reference in New Issue
Block a user