Backed out changeset f7c32e7abf72 (bug 1498458) for causing SM build bustages on oom-allocating-arraybuffer-contents.

This commit is contained in:
Cosmin Sabou 2018-10-13 04:51:18 +03:00
Родитель fb511e7d71
Коммит ebf0206758
2 изменённых файлов: 2 добавлений и 10 удалений

Просмотреть файл

@ -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;