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 | 1c42487c2d5daab7f4914edcfd388d23ae812203 (patch) | |
tree | c2000c998bd6c3b7ffa0993da71707ae3f83b10a /js | |
parent | 2e329f53d3138ac75675b835ee664384813d28cb (diff) | |
download | uxp-1c42487c2d5daab7f4914edcfd388d23ae812203.tar.gz |
WASM: Set OOM failure flag on alloc failure when context is available.
Diffstat (limited to 'js')
-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 be7ddba8f6..b24e01a400 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), |