fix: 迭代器包装对象分配走统一入口登记 epoch 对象表——执行期 epoch 换新只晋升表内对象,绕过登记的包装器/结果对象在换新后悬垂,闭合

This commit is contained in:
2026-09-13 00:41:48 +00:00
parent 6aff1101f3
commit c49cdbf9c5
5 changed files with 199 additions and 24 deletions
+1 -3
View File
@@ -563,9 +563,7 @@ pub fn regexp_symbol_match_all<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResu
// 复用 String.prototype.matchAll 的迭代器包装(next 经 string_match_all_next 推进,
// 挂 %RegExpStringIteratorPrototype% 原型,不设实例 own next)。
let regexp_iter_proto = vm.session().builtin_world().regexp_string_iterator_proto.as_ptr() as *mut JsObject;
let wrapper = vm
.epoch()
.alloc(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::from_js_object(regexp_iter_proto)));
let wrapper = vm.alloc_object(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::from_js_object(regexp_iter_proto)));
let wrapper_obj = unsafe { &mut *wrapper };
let input_si = vm.kernel_core().perm_interner().intern(crate::string::MALL_INPUT).0;
let index_si = vm.kernel_core().perm_interner().intern(crate::string::MALL_INDEX).0;