fix: 修复属性分配溢出导致内存访问错误问题

This commit is contained in:
2026-06-06 21:26:48 +08:00
parent 85f594dc05
commit 8f973498ef
+3 -2
View File
@@ -146,8 +146,9 @@ impl JsObject {
}
pub fn set_prop_expand(&mut self, offset: u8, val: JsValue, bump: &bumpalo::Bump) {
if offset >= 4 && (self.overflow.is_null() || offset >= self.prop_count()) {
self.alloc_overflow(bump, (offset as usize) + 1);
if offset >= 4 {
let needed = (offset as usize) + 1;
self.alloc_overflow(bump, needed.max(8));
}
self.set_prop(offset, val);
}