feat: 七类作用域出口正常释放 using 资源,for-of 每迭代

This commit is contained in:
2026-10-09 18:40:24 +00:00
parent b5ff2c132a
commit 48ffb54c4f
19 changed files with 473 additions and 46 deletions
+4 -1
View File
@@ -131,6 +131,7 @@ impl Vm {
save_stack: Vec::new(),
spill_stack: Vec::new(),
dispose_stack: Vec::new(),
dispose_marks: Vec::new(),
native_overflow_base: 0,
native_overflow_count: 0,
try_stack: Vec::new(),
@@ -293,6 +294,7 @@ impl Vm {
save_stack: Vec::new(),
spill_stack: Vec::new(),
dispose_stack: Vec::new(),
dispose_marks: Vec::new(),
native_overflow_base: 0,
native_overflow_count: 0,
try_stack: Vec::new(),
@@ -518,8 +520,9 @@ impl Vm {
self.save_stack.clear();
self.spill_stack.clear();
// 释放栈条目持资源值(session 对象指针):跨 run/reset 残留会在下一 run
// 被误释放或悬垂,随执行状态一并清空。
// 被误释放或悬垂,随执行状态一并清空;水位栈同清,防陈旧水位误截断。
self.dispose_stack.clear();
self.dispose_marks.clear();
self.native_overflow_base = 0;
self.native_overflow_count = 0;
// native pack 实参区上界与溢出描述符同构:仅一次 native 调用期间有效,