mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 03:01:12 +08:00
fix: finally 体直落进入时置位 finally_active 防完成穿越计数错乱
catch 体正常结束后指令直落入 finally 体,此前 finally_active 未被置位, finally 内 break/continue/return/throw 触发未进入分支导致 finally 体重复 执行、完成计数错乱。新增无操作数标记指令 TRY_FINALLY_ENTER,在 finally 体入口统一置位栈顶 handler 的 finally_active,覆盖 JMP/直落/unwind/完成 穿越/挂起恢复全部进入路径,并删除 control_flow.rs 中对跳转目标匹配的 脆弱栈顶检测。
This commit is contained in:
@@ -1811,6 +1811,10 @@ impl Vm {
|
||||
self.dispatch_try_finally_begin(instr);
|
||||
}
|
||||
|
||||
OpCode::TRY_FINALLY_ENTER => {
|
||||
self.dispatch_try_finally_enter();
|
||||
}
|
||||
|
||||
OpCode::TRY_FINALLY_END => match self.dispatch_try_finally_end() {
|
||||
Ok(Some(result)) => return Ok(result),
|
||||
Ok(None) => {}
|
||||
|
||||
Reference in New Issue
Block a user