summaryrefslogtreecommitdiffstats
path: root/js/src/wasm/WasmModule.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-02-07 14:39:35 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-02-07 14:39:35 +0100
commit2a10b213f1d33511ca3c3602ca39b8b69dced935 (patch)
treec2000c998bd6c3b7ffa0993da71707ae3f83b10a /js/src/wasm/WasmModule.cpp
parentf8d1830b530cd553d788b3579d41725d35c4da7f (diff)
downloadUXP-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/wasm/WasmModule.cpp')
-rw-r--r--js/src/wasm/WasmModule.cpp8
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),