зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset f7c32e7abf72 (bug 1498458) for causing SM build bustages on oom-allocating-arraybuffer-contents.
This commit is contained in:
Родитель
fb511e7d71
Коммит
ebf0206758
|
@ -1,8 +0,0 @@
|
|||
// |jit-test| skip-if: !('oomTest' in this)
|
||||
|
||||
oomTest(function test() {
|
||||
// The original missing OOM check was after failure to allocate ArrayBuffer
|
||||
// contents, in the ctor call -- the particular operations after that aren't
|
||||
// important.
|
||||
new Uint8ClampedArray(256).toLocaleString('hi');
|
||||
});
|
|
@ -463,7 +463,8 @@ ArrayBufferObject::class_constructor(JSContext* cx, unsigned argc, Value* vp)
|
|||
static ArrayBufferObject::BufferContents
|
||||
AllocateArrayBufferContents(JSContext* cx, uint32_t nbytes)
|
||||
{
|
||||
uint8_t* p = cx->pod_callocCanGC<uint8_t>(nbytes, js::ArrayBufferContentsArena);
|
||||
uint8_t* p = cx->pod_callocCanGC<uint8_t>(nbytes,
|
||||
js::ArrayBufferContentsArena);
|
||||
return ArrayBufferObject::BufferContents::create<ArrayBufferObject::PLAIN>(p);
|
||||
}
|
||||
|
||||
|
@ -1249,7 +1250,6 @@ ArrayBufferObject::create(JSContext* cx, uint32_t nbytes, BufferContents content
|
|||
} else {
|
||||
contents = AllocateArrayBufferContents(cx, nbytes);
|
||||
if (!contents) {
|
||||
ReportOutOfMemory(cx);
|
||||
return nullptr;
|
||||
}
|
||||
allocated = true;
|
||||
|
|
Загрузка…
Ссылка в новой задаче