<?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>313268</bug_id>
          
          <creation_ts>2026-04-24 14:47:19 -0700</creation_ts>
          <short_desc>FTL operationPopulateObjectInOSR null deref for sunk Int32/Contiguous arrays with holes</short_desc>
          <delta_ts>2026-05-11 16:59:31 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <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>s96565100</reporter>
          <assigned_to name="Shu-yu Guo">syg</assigned_to>
          <cc>entryhii</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2204281</commentid>
    <comment_count>0</comment_count>
    <who name="">s96565100</who>
    <bug_when>2026-04-24 14:47:19 -0700</bug_when>
    <thetext>The vulnerable logic is located in JavaScriptCore/ftl/FTLOperations.cpp, around lines 110. The 1 day old fix 289a55e3913b covers NaN for double rematerialization but misses the empty JSValue case for Int32/Contiguous sunk arrays. putDirectIndex&apos;s debug ASSERT(!value.isCustomGetterSetterSlow()) dereferences null because JSValue() satisfies isCell() (x86_64: asInt64==0 passes !(xyz &amp;NotCellMask)) while asCell() returns null

The stack dump looks like this

JSCell::isCustomGetterSetter(this=0x0) → JSValue::isCustomGetterSetter → JSValue::isCustomGetterSetterSlow → JSObject::putDirectIndex → FTL::operationPopulateObjectInOSR

And the reproduction is as follows

  function hot(i) {
      let a = new Array(4);
      a[0] = 0;
      if (i &amp; 1) a[3] = null;
      if (i === 500000) Object.defineProperty(Array.prototype, &apos;1&apos;, {get() {}, configurable:
  true});
      if (i &amp; 4) return a;
  }
  noInline(hot);
  for (let i = 0; i &lt; 1500000; i++) hot(i);


the poc crashes at default jsc flags without noInline or any api which is not standard, therefore it is web compatible js. mutation fuzzing (2500 cases) found 15 crashes, all with identical stacks. the common thread is any operation that disturbs an array&apos;s shape or prototype. sealing or freezing it, defining properties on length or an index, deleting entries from Array.prototype, adding a getter to Array.prototype, swapping the prototype for a proxy, or pairing Reflect.deleteProperty with a prototype swap. this is a follow up to Bugzilla 312664.

for the fix, same as the landed fix, extended to Int32/Contiguous. when the value is empty, write the hole straight into the butterfly rather than going through putDirectIndex.

else if ((hasInt32(array-&gt;indexingType()) || hasContiguous(array-&gt;indexingType())) &amp;&amp; !value) [[unlikely]]
    array-&gt;butterfly()-&gt;contiguous().atUnsafe(index).setStartingValue(JSValue());</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2206680</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-05-01 14:48:12 -0700</bug_when>
    <thetext>&lt;rdar://problem/176051382&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2209190</commentid>
    <comment_count>2</comment_count>
    <who name="Shu-yu Guo">syg</who>
    <bug_when>2026-05-08 16:21:16 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/64583</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2209804</commentid>
    <comment_count>3</comment_count>
    <who name="Shu-yu Guo">syg</who>
    <bug_when>2026-05-11 11:35:05 -0700</bug_when>
    <thetext>*** Bug 314521 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2209908</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-05-11 16:59:30 -0700</bug_when>
    <thetext>Committed 313041@main (d9cbe05de1dc): &lt;https://commits.webkit.org/313041@main&gt;

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

    </bug>

</bugzilla>