<?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>208639</bug_id>
          
          <creation_ts>2020-03-05 06:21:08 -0800</creation_ts>
          <short_desc>an issue about Array.prototype.lastIndexOf</short_desc>
          <delta_ts>2020-03-24 09:40:32 -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 Local Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>163417</dup_id>
          
          <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="Livy">958268052</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ashvayka</cc>
    
    <cc>fpizlo</cc>
    
    <cc>keith_miller</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1626039</commentid>
    <comment_count>0</comment_count>
    <who name="Livy">958268052</who>
    <bug_when>2020-03-05 06:21:08 -0800</bug_when>
    <thetext>Description:
According to ES10, the method Array.prototype.lastIndexOf() returns the last index at which a given element can be found in the array, or -1 if it is not present.When the array&apos;s length is 4294967296, it will take a long time to find the element because the array is searched backwards. But the engine actually did not, it returned soonly. From ES6.0, the standard uses &quot;ToLength&quot; to deal with the property &quot;length&quot; not &quot;ToUint32&quot;. JavaScriptCore doesn&apos;t meet this request.

Version:b96bf75
https://github.com/WebKit/webkit/commit/b96bf7590bc090fa8161cff1189255ca3319c94b

Build steps:
Tools/Scripts/build-webkit --debug --jsc-only -j

Testcase:
var NISLFuzzingFunc = function() {
    var obj = {
        0:12,
        length:4294967296
    };
    Array.prototype.lastIndexOf.call(obj, 12);
};
NISLFuzzingFunc();

Execution steps:
webkit/WebKitBuild/Debug/bin/jsc testcase.js</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1626355</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-03-05 15:56:57 -0800</bug_when>
    <thetext>&lt;rdar://problem/60104993&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1633354</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Shvayka">ashvayka</who>
    <bug_when>2020-03-24 09:40:32 -0700</bug_when>
    <thetext>Thank you for detailed report.
Apart from Array.prototype.lastIndexOf, other Array methods (mostly ones that are implemented in C++) are affected.
I am merging all bug reports to fix all (observable) cases with a single patch.

*** This bug has been marked as a duplicate of bug 163417 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>