Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 74efecb8e0d1e43dea71093f25a1aab4ec9383ff
https://github.com/WebKit/WebKit/commit/74efecb8e0d1e43dea71093f25a1aab4ec9383ff
Author: Yijia Huang <[email protected]>
Date: 2026-09-15 (Tue, 15 Sep 2026)
Changed paths:
M Source/JavaScriptCore/wasm/WasmIPIntSlowPaths.cpp
M Source/JavaScriptCore/wasm/WasmModuleInformation.cpp
M Source/JavaScriptCore/wasm/WasmModuleInformation.h
M Source/JavaScriptCore/wasm/debugger/WasmExecutionHandler.cpp
M Source/JavaScriptCore/wasm/debugger/WasmModuleDebugInfo.cpp
M Source/JavaScriptCore/wasm/debugger/WasmModuleDebugInfo.h
M Source/JavaScriptCore/wasm/debugger/WasmModuleManager.cpp
M Source/JavaScriptCore/wasm/debugger/WasmQueryHandler.cpp
Log Message:
-----------
[JSC] Don't leak every WASM module when the debugger is enabled
https://bugs.webkit.org/show_bug.cgi?id=324214
rdar://187437158
Reviewed by Yusuke Suzuki.
ModuleInformation owns ModuleDebugInfo through a unique_ptr and constructed it
with *this; ModuleDebugInfo held a Ref back. The refcount never reached zero, so
no ModuleInformation was destroyed once enableWasmDebugger() was set, leaking
the
bytecode and a second full copy of the module bytes per module compiled.
The back-reference is gone rather than weakened, because neither method that
used
it belonged on ModuleDebugInfo. declaredName() reads only sourceURL and
nameSection(), both ModuleInformation members, and merely cached its result in
the
wrong struct. ensureFunctionDebugInfo() needs functions, toSpaceIndex() and
rtt()
from the module. Both now live on ModuleInformation, ModuleDebugInfo is pure
data,
and the call sites are shorter than before: moduleInfo.declaredName() and
moduleInfo.ensureFunctionDebugInfo(index).
Canonical link: https://commits.webkit.org/321196@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications