Branch: refs/heads/webkitglib/2.50
  Home:   https://github.com/WebKit/WebKit
  Commit: 4bed14f8ced1b4d260fe8f71a474dc8992c47ea7
      
https://github.com/WebKit/WebKit/commit/4bed14f8ced1b4d260fe8f71a474dc8992c47ea7
  Author: Nikolas Zimmermann <[email protected]>
  Date:   2025-09-23 (Tue, 23 Sep 2025)

  Changed paths:
    M Source/WebCore/css/CSSPrimitiveValue.cpp
    M Source/WebCore/css/CSSValuePool.cpp
    M Source/WebCore/css/CSSValuePool.h

  Log Message:
  -----------
  Cherry-pick 299936@main (d97070b32b34). 
https://bugs.webkit.org/show_bug.cgi?id=298814

    Do not store LazyNeverDestroyed objects as member variables
    https://bugs.webkit.org/show_bug.cgi?id=298814

    Reviewed by Darin Adler.

    Stop using LazyNeverDestroyed for member variables in StaticCSSValuePool.

    This triggers undefined behavior in ASSERT_ENABLED builds, since the
    'm_isConstructed' member of LazyNeverDestroyed<T> is not initialized
    in that case. GCC 14 correctly warned about this, breaking the build
    on e.g. Ubuntu 25.04, where GCC 14 is default.

    The straightforward solution was to directly use AlignedStorage<T>
    as type for the pool member variables instead of LazyNeverDestroyed<T>,
    preserving the current performance characteristics (no dynamic
    allocations, etc.). The "canonical" solution of using e.g.
    Vector<RefPtr<CSSPrimitiveValue>> would re-introduce the memory
    problems which were previously migitiated by introducing
    std::array<LazyNeverDestroyed<...>, capacity> -- thus it is not
    applicable here.

    Covered by existing tests.

    * Source/WebCore/css/CSSPrimitiveValue.cpp:
    (WebCore::valueFromPool):
    * Source/WebCore/css/CSSValuePool.cpp:
    (WebCore::StaticCSSValuePool::StaticCSSValuePool):
    (WebCore::CSSValuePool::createColorValue):
    * Source/WebCore/css/CSSValuePool.h:
    (WebCore::CSSPrimitiveValue::implicitInitialValue):
    (WebCore::CSSPrimitiveValue::create):

    Canonical link: https://commits.webkit.org/299936@main

Canonical link: https://commits.webkit.org/298234.149@webkitglib/2.50



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to