1330491 - Assertion failure: maybeBytecode, at js/src/wasm/WasmCode.cpp:581 with Debugger

1330491 - Always provide wasm bytecode for debuggable instance.
This commit is contained in:
win7-7 2025-12-30 03:32:40 +02:00 committed by wuggy
commit 842bee4099

View file

@ -880,13 +880,16 @@ Module::instantiate(JSContext* cx,
// instance must hold onto a ref of the bytecode (keeping it alive). This
// wastes memory for most users, so we try to only save the source when a
// developer actually cares: when the compartment is debuggable (which is
// true when the web console is open) or a names section is present (since
// this going to be stripped for non-developer builds).
// true when the web console is open), has code compiled with debug flag
// enabled or a names section is present (since this going to be stripped
// for non-developer builds).
const ShareableBytes* maybeBytecode = nullptr;
if (cx->compartment()->isDebuggee() || !metadata_->funcNames.empty())
if (cx->compartment()->isDebuggee() || metadata_->debugEnabled ||
!metadata_->funcNames.empty())
{
maybeBytecode = bytecode_.get();
}
auto codeSegment = CodeSegment::create(cx, code_, linkData_, *metadata_, memory);
if (!codeSegment) {
ReportOutOfMemory(cx);