fix: 修复溢出分配失效堆空间溢出问题

This commit is contained in:
爱特每羊队
2026-06-07 10:10:21 +08:00
parent 2244abd6bd
commit bd8167d29c
+2 -5
View File
@@ -241,11 +241,8 @@ impl JsObject {
}
pub fn set_prop_expand_heap(&mut self, offset: u8, val: JsValue) {
if offset >= 4 {
let needed = (offset as usize) + 1;
if self.overflow.is_null() || offset >= self.prop_count() + 4 {
self.alloc_overflow_heap(needed.max(8));
}
if offset >= 4 && self.overflow.is_null() {
self.alloc_overflow_heap(32);
}
self.set_prop(offset, val);
}