зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1642940 - Report OOM on table allocation failure. r=lth
Table::create() returns false when allocation fails, but does not report the OOM. This commit adds appropriate calls to ReportOutOfMemory around calls to Table::create(). Differential Revision: https://phabricator.services.mozilla.com/D80754
This commit is contained in:
Родитель
fe6aa87a6d
Коммит
87ef44e6ab
|
@ -2437,6 +2437,7 @@ WasmTableObject* WasmTableObject::create(JSContext* cx, uint32_t initialLength,
|
|||
|
||||
SharedTable table = Table::create(cx, td, obj);
|
||||
if (!table) {
|
||||
ReportOutOfMemory(cx);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -843,6 +843,7 @@ bool Module::instantiateLocalTable(JSContext* cx, const TableDesc& td,
|
|||
} else {
|
||||
table = Table::create(cx, td, /* HandleWasmTableObject = */ nullptr);
|
||||
if (!table) {
|
||||
ReportOutOfMemory(cx);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче