<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>306244</bug_id>
          
          <creation_ts>2026-01-25 19:50:49 -0800</creation_ts>
          <short_desc>Fix -Wlifetime-safety-permissive warning in FontRanges::glyphDataForCharacter()</short_desc>
          <delta_ts>2026-01-26 13:51:30 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Text</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=306226</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="David Kilzer (:ddkilzer)">ddkilzer</assigned_to>
          <cc>fantasai.bugs</cc>
    
    <cc>vitor.roriz</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2174988</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2026-01-25 19:50:49 -0800</bug_when>
    <thetext>Clang&apos;s lifetime safety warning detected a potential issue in FontRanges::glyphDataForCharacter():

```
OpenSource/Source/WebCore/platform/graphics/FontRanges.cpp:94:38: error: object whose reference is captured may not live long enough [-Werror,-Wlifetime-safety-strict]
   94 |                         resultFont = font.get();
      |                                      ^~~~
OpenSource/Source/WebCore/platform/graphics/FontRanges.cpp:104:13: note: destroyed here
  104 |             }
      |             ^
OpenSource/Source/WebCore/platform/graphics/FontRanges.cpp:93:26: note: later used here
   93 |                     if (\!resultFont)
      |                          ^~~~~~~~~~
```

Even though the code was safe (the Font is kept alive by the FontAccessor), the analyzer couldn&apos;t prove the lifetime relationship.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2174989</commentid>
    <comment_count>1</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2026-01-25 19:50:51 -0800</bug_when>
    <thetext>The fix changes `resultFont` from `const Font*` to `RefPtr&lt;const Font&gt;` to make the lifetime relationship explicit and eliminate the warning. Also uses `WTF::move(font)` to avoid ref count churn since `font` isn&apos;t used after that point in the `isInterstitial()` branch.

No change in behavior, only compiler warning elimination.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2174990</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-01-25 19:50:55 -0800</bug_when>
    <thetext>&lt;rdar://problem/168892583&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2174991</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-01-25 19:50:56 -0800</bug_when>
    <thetext>&lt;rdar://problem/168892499&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2174999</commentid>
    <comment_count>4</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2026-01-25 20:15:34 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/57231</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2175246</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-01-26 13:51:27 -0800</bug_when>
    <thetext>Committed 306238@main (3118028cc9ac): &lt;https://commits.webkit.org/306238@main&gt;

Reviewed commits have been landed. Closing PR #57231 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>