Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b17bfa757d0cb010585bc9baac8bda50da1e5ee9
      
https://github.com/WebKit/WebKit/commit/b17bfa757d0cb010585bc9baac8bda50da1e5ee9
  Author: Vassili Bykov <[email protected]>
  Date:   2025-11-05 (Wed, 05 Nov 2025)

  Changed paths:
    M Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp

  Log Message:
  -----------
  In JSWebAssemblyInstance.cpp, replace the blanket "using namespace Wasm" 
directive with specific using declarations
https://bugs.webkit.org/show_bug.cgi?id=302041
rdar://164119670

Reviewed by Daniel Liu and Dan Hecht.

Because of the unified source build mechanism, the "using namespace Wasm" 
directive in the
JSC namespace in JSWebAssemblyInstance.cpp can cause a random build failure if 
a source
file that uses a name from JSC which is also defined in Wasm is included in the 
unified
source following JSWebAssemblyInstance.cpp.

One such name is InternalFunction. There is JSC::InternalFunction, and also
JSC::Wasm::InternalFunction. JSC::InternalFunction is used by its unqualified 
name as a
superclass of many classes in JSC. The "using namespace Wasm" directive in
JSWebAssemblyInstance.cpp brings JSC::Wasm::InternalFunction into the namespace 
JSC as a
second definition associated with that unqualified name. This duplicate 
definition is then
present in any namespace JSC definition appearing after 
JSWebAssemblyInstance.cpp in the
unified source. Any file included into the unified source afterwards and 
defining a
subclass of InternalFunction will then fail with an ambiguous reference error.

To avoid this fragility, JSWebAssemblyInstance.cpp should use specific using 
declarations
for the Wasm names it needs.

Tests: not directly testable.
Canonical link: https://commits.webkit.org/302625@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to