<?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>187777</bug_id>
          
          <creation_ts>2018-07-18 11:47:43 -0700</creation_ts>
          <short_desc>Unexpected behavior if object length property exceed 2³²</short_desc>
          <delta_ts>2020-03-24 09:42:09 -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>Safari 11</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>isol2</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ashvayka</cc>
    
    <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1443102</commentid>
    <comment_count>0</comment_count>
    <who name="">isol2</who>
    <bug_when>2018-07-18 11:47:43 -0700</bug_when>
    <thetext>Hi everyone,

I found an inconsistency on JSC when we try to push a new element into an Object that uses Array.prototype.push method.
Seems like a conversion ToUint32 on JSC while the others engines exceed this value. 
In addiction, it was observed that JSC push the element in index 0 and index length-1.

OS: Ubuntu 16.04 x64
build version: 233840

Step to reproduce:
var o = { length : 2**32, push : Array.prototype.push };
print(o.push(&apos;A&apos;));
print(o[0], o[o.length-1]);

Actual results:
1
A A

Expected results:
4294967297
undefined A

V8, SpiderMonkey, Chakra and XS works as expected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1448750</commentid>
    <comment_count>1</comment_count>
    <who name="">isol2</who>
    <bug_when>2018-08-08 08:23:17 -0700</bug_when>
    <thetext>cinfuzz</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1633357</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Shvayka">ashvayka</who>
    <bug_when>2020-03-24 09:42:09 -0700</bug_when>
    <thetext>Thank you for detailed report.
Apart from Array.prototype.push, other Array methods (mostly ones that are implemented in C++) are affected.
I am merging 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>