summaryrefslogtreecommitdiffstats
path: root/js/src
diff options
context:
space:
mode:
Diffstat (limited to 'js/src')
-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),