From 842bee409956d29b3b8a54f096d347352d7ce5d9 Mon Sep 17 00:00:00 2001 From: win7-7 Date: Tue, 30 Dec 2025 03:32:40 +0200 Subject: [PATCH] 1330491 - Assertion failure: maybeBytecode, at js/src/wasm/WasmCode.cpp:581 with Debugger 1330491 - Always provide wasm bytecode for debuggable instance. --- js/src/wasm/WasmModule.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/js/src/wasm/WasmModule.cpp b/js/src/wasm/WasmModule.cpp index 0f29e167e5..afd950eb94 100644 --- a/js/src/wasm/WasmModule.cpp +++ b/js/src/wasm/WasmModule.cpp @@ -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);