mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 03:49:42 +00:00
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:
parent
813131c727
commit
0c490d558c
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user