Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3118028cc9ac7136c21d9051272a74cdfd39bbd9
      
https://github.com/WebKit/WebKit/commit/3118028cc9ac7136c21d9051272a74cdfd39bbd9
  Author: David Kilzer <[email protected]>
  Date:   2026-01-26 (Mon, 26 Jan 2026)

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

  Log Message:
  -----------
  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



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

Reply via email to