fix: CREATE_CLOSURE 跨 run 帧按执行帧表代际解析——嵌套闭包错代盖写闭合,挂起恢复重设活跃代际,OOB 消息上界对齐实际查表代际

This commit is contained in:
2026-09-12 22:04:42 +00:00
parent bf08803071
commit 41a3aef29e
6 changed files with 78 additions and 25 deletions
+3 -2
View File
@@ -105,11 +105,12 @@ impl Vm {
let sub = match self.callee_module(ctor_obj) {
Some(m) => m,
None => {
// 上界取构造器自身代际平表长度(跨 run 调用时可异于当前代际)。
return Err(format!(
"NEW_EXPRESSION: sub_module_index {} out of bounds (max {})",
sub_idx,
self.current_table().modules.len()
))
self.tables.get(&ctor_obj.table_gen()).map(|t| t.modules.len()).unwrap_or(0)
));
}
};
// 生成器函数不是构造器:`new g()` 抛 TypeError。