diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-02-07 14:39:35 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-02-07 14:39:35 +0100 |
commit | 2a10b213f1d33511ca3c3602ca39b8b69dced935 (patch) | |
tree | c2000c998bd6c3b7ffa0993da71707ae3f83b10a /js/src | |
parent | f8d1830b530cd553d788b3579d41725d35c4da7f (diff) | |
download | UXP-2a10b213f1d33511ca3c3602ca39b8b69dced935.tar UXP-2a10b213f1d33511ca3c3602ca39b8b69dced935.tar.gz UXP-2a10b213f1d33511ca3c3602ca39b8b69dced935.tar.lz UXP-2a10b213f1d33511ca3c3602ca39b8b69dced935.tar.xz UXP-2a10b213f1d33511ca3c3602ca39b8b69dced935.zip |
WASM: Set OOM failure flag on alloc failure when context is available.
Diffstat (limited to 'js/src')
-rw-r--r-- | js/src/wasm/WasmModule.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/js/src/wasm/WasmModule.cpp b/js/src/wasm/WasmModule.cpp index be7ddba8f..b24e01a40 100644 --- a/js/src/wasm/WasmModule.cpp +++ b/js/src/wasm/WasmModule.cpp @@ -1007,12 +1007,16 @@ Module::instantiate(JSContext* cx, maybeBytecode = bytecode_.get(); auto codeSegment = CodeSegment::create(cx, code_, linkData_, *metadata_, memory); - if (!codeSegment) + if (!codeSegment) { + ReportOutOfMemory(cx); return false; + } auto code = cx->make_unique<Code>(Move(codeSegment), *metadata_, maybeBytecode); - if (!code) + if (!code) { + ReportOutOfMemory(cx); return false; + } instance.set(WasmInstanceObject::create(cx, Move(code), |