fix: 修复溢出分配失效堆空间溢出问题
This commit is contained in:
@@ -241,11 +241,8 @@ impl JsObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_prop_expand_heap(&mut self, offset: u8, val: JsValue) {
|
pub fn set_prop_expand_heap(&mut self, offset: u8, val: JsValue) {
|
||||||
if offset >= 4 {
|
if offset >= 4 && self.overflow.is_null() {
|
||||||
let needed = (offset as usize) + 1;
|
self.alloc_overflow_heap(32);
|
||||||
if self.overflow.is_null() || offset >= self.prop_count() + 4 {
|
|
||||||
self.alloc_overflow_heap(needed.max(8));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
self.set_prop(offset, val);
|
self.set_prop(offset, val);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user