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:
2026-08-15 07:47:54 +08:00
parent ed964b5e2b
commit 31ca1dd5db
8 changed files with 105 additions and 9 deletions
+1
View File
@@ -674,6 +674,7 @@ mod tests {
OpCode::TRY_BEGIN,
OpCode::TRY_END,
OpCode::TRY_FINALLY_BEGIN,
OpCode::TRY_FINALLY_ENTER,
OpCode::TRY_FINALLY_END,
OpCode::FOR_IN_CLEANUP,
OpCode::FOR_OF_CLOSE,