[Webkit-unassigned] [Bug 228876] New: Fix ODR violations in JSC

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 6 14:33:20 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=228876

            Bug ID: 228876
           Summary: Fix ODR violations in JSC
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mcatanzaro at gnome.org

When built with LTO enabled, GCC will warn about violations of C++'s one-definition rule. JSC currently has two violations. The first is JSC::SpeciesConstructResult, which has two different declarations:

runtime/ArrayPrototype.cpp:enum class SpeciesConstructResult {
runtime/JSArrayBufferPrototype.cpp:enum class SpeciesConstructResult : uint8_t {

There are usually several different ways to fix any particular ODR violation, starting with renaming one or the other use. I decided to add : uint8_t to the version in ArrayPrototype.cpp to make the declarations match. I could alternatively have placed them in anonymous namespaces to restrict them to file scope.

The next problem is JSC::SignalContext. We have two different versions of this struct, one in VMTraps.cpp and the other in SigillCrashAnalyzer.cpp. In this case, I decided the simplest approach would be to change the one in VMTraps.cpp from JSC::SignalContext to JSC::VMTraps::SignalContext.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210806/c655f6d5/attachment.htm>


More information about the webkit-unassigned mailing list