Branch: refs/heads/webkitglib/2.50
  Home:   https://github.com/WebKit/WebKit
  Commit: a96dfdc0efc455e16699f7ee5b06db561b3a24c0
      
https://github.com/WebKit/WebKit/commit/a96dfdc0efc455e16699f7ee5b06db561b3a24c0
  Author: David Kilzer <[email protected]>
  Date:   2026-01-27 (Tue, 27 Jan 2026)

  Changed paths:
    M Source/WebCore/xml/XPathNodeSet.cpp

  Log Message:
  -----------
  Cherry-pick 306240@main (7a9af69f9b93). 
https://bugs.webkit.org/show_bug.cgi?id=306226

    Fix -Wlifetime-safety-permissive warning in XPathNodeSet::findRootNode()
    <https://bugs.webkit.org/show_bug.cgi?id=306226>
    <rdar://problem/168880148>

    Reviewed by Geoffrey Garen.

    Clang's -Wlifetime-safety-permissive warning detected a potential issue
    in the findRootNode() function.

    The fix introduces `RefPtr<Node> current` to maintain proper lifetime
    management throughout the function.  This is necessary because
    `attr->ownerElement()` returns a raw pointer from a `WeakPtr<Element>`,
    so when the `RefPtr attr` goes out of scope after the if statement,
    nothing would keep the ownerElement alive if we stored it in a raw
    pointer.

    Similarly, the while loop's `RefPtr parent` was destroyed at the end of
    each loop iteration while `node` held a raw pointer to it.  The while
    loop is also changed to a for loop to avoid recreating the `RefPtr
    parent` variable on each loop iteration.

    findRootNode() is also changed to inline and to return `RefPtr<Node>`
    since its single caller stores the result in a `RefPtr`.

    No new tests since no change in behavior.

    * Source/WebCore/xml/XPathNodeSet.cpp:
    (WebCore::XPath::findRootNode):

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

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


  Commit: 40957408cb72c97507e3f4cf0bc1e2a287b213d4
      
https://github.com/WebKit/WebKit/commit/40957408cb72c97507e3f4cf0bc1e2a287b213d4
  Author: David Kilzer <[email protected]>
  Date:   2026-01-27 (Tue, 27 Jan 2026)

  Changed paths:
    M Source/WebCore/platform/graphics/FontRanges.cpp

  Log Message:
  -----------
  Cherry-pick 306238@main (3118028cc9ac). 
https://bugs.webkit.org/show_bug.cgi?id=306244

    Fix -Wlifetime-safety-permissive warning in 
FontRanges::glyphDataForCharacter()
    <https://bugs.webkit.org/show_bug.cgi?id=306244>
    <rdar://problem/168892583>

    Reviewed by Darin Adler.

    Clang's lifetime safety warning detected a potential issue where a raw
    pointer was assigned from a RefPtr that goes out of scope.  Even though
    the code was safe (the Font is kept alive by the FontAccessor), the
    analyzer couldn't prove the lifetime relationship.

    The fix changes `resultFont` from `const Font*` to `RefPtr<const Font>`
    to make the lifetime relationship explicit.  Also uses `WTF::move(font)`
    to avoid ref count churn since `font` isn't used after that point in
    the `isInterstitial()` branch.

    No new tests since no change in behavior.

    * Source/WebCore/platform/graphics/FontRanges.cpp:
    (WebCore::FontRanges::glyphDataForCharacter):

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

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


Compare: https://github.com/WebKit/WebKit/compare/e773ad083a13...40957408cb72

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

Reply via email to