mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 14:58:37 +09:00
WASM: Set OOM failure flag on alloc failure when context is available.
This commit is contained in:
parent
faf5d8c1c4
commit
d0a1bf03fb
1 changed files with 6 additions and 2 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue