Bug 302041
| Summary: | In JSWebAssemblyInstance.cpp, replace the blanket "using namespace Wasm" directive with specific using declarations | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Vassili Bykov <v_bykov> |
| Component: | JavaScriptCore | Assignee: | Vassili Bykov <v_bykov> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Vassili Bykov
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 that defines 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.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/164119670>
Vassili Bykov
Pull request: https://github.com/WebKit/WebKit/pull/53483
EWS
Committed 302625@main (b17bfa757d0c): <https://commits.webkit.org/302625@main>
Reviewed commits have been landed. Closing PR #53483 and removing active labels.