mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-28 20:55:39 +00:00
Bug 1184388 - Don't try to reallocate inline elements buffer of unboxed arrays, r=jandem.
This commit is contained in:
parent
6073d46e10
commit
9c51bf3b2f
@ -1040,9 +1040,14 @@ UnboxedArrayObject::convertInt32ToDouble(ExclusiveContext* cx, ObjectGroup* grou
|
||||
for (size_t i = 0; i < initializedLength(); i++)
|
||||
values.infallibleAppend(getElementSpecific<JSVAL_TYPE_INT32>(i).toInt32());
|
||||
|
||||
uint8_t* newElements = ReallocateObjectBuffer<uint8_t>(cx, this, elements(),
|
||||
uint8_t* newElements;
|
||||
if (hasInlineElements()) {
|
||||
newElements = AllocateObjectBuffer<uint8_t>(cx, this, capacity() * sizeof(double));
|
||||
} else {
|
||||
newElements = ReallocateObjectBuffer<uint8_t>(cx, this, elements(),
|
||||
capacity() * sizeof(int32_t),
|
||||
capacity() * sizeof(double));
|
||||
}
|
||||
if (!newElements)
|
||||
return false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user