Title: [214977] trunk/JSTests
Revision
214977
Author
[email protected]
Date
2017-04-05 16:31:35 -0700 (Wed, 05 Apr 2017)

Log Message

REGRESSION (Safari 10.1): Inserting elements into arrays fails when array contains very large numbers
https://bugs.webkit.org/show_bug.cgi?id=170264
<rdar://problem/31375593>

Rubber-stamped by Saam Barati.

The original bug was fixed in: https://trac.webkit.org/changeset/214714
I'm just adding another test for good measure.

* stress/double-array-to-array-storage.js: Added.
(assert):

Modified Paths

Added Paths

Diff

Modified: trunk/JSTests/ChangeLog (214976 => 214977)


--- trunk/JSTests/ChangeLog	2017-04-05 23:22:20 UTC (rev 214976)
+++ trunk/JSTests/ChangeLog	2017-04-05 23:31:35 UTC (rev 214977)
@@ -1,3 +1,17 @@
+2017-04-05  Michael Saboff  <[email protected]>
+
+        REGRESSION (Safari 10.1): Inserting elements into arrays fails when array contains very large numbers
+        https://bugs.webkit.org/show_bug.cgi?id=170264
+        <rdar://problem/31375593>
+
+        Rubber-stamped by Saam Barati.
+
+        The original bug was fixed in: https://trac.webkit.org/changeset/214714
+        I'm just adding another test for good measure.
+
+        * stress/double-array-to-array-storage.js: Added.
+        (assert):
+
 2017-04-05  Keith Miller  <[email protected]>
 
         WebAssembly: We shouldn't need to pin size registers if we have a fast memory.

Added: trunk/JSTests/stress/double-array-to-array-storage.js (0 => 214977)


--- trunk/JSTests/stress/double-array-to-array-storage.js	                        (rev 0)
+++ trunk/JSTests/stress/double-array-to-array-storage.js	2017-04-05 23:31:35 UTC (rev 214977)
@@ -0,0 +1,33 @@
+"use strict";
+
+function assert(b, msg) {
+    if (!b)
+        throw new Error(msg);
+}
+
+var arr = [];
+
+function test()
+{
+    arr = [0, 2147483648]; // NOTE: the second number is greater than INT_MAX
+
+    assert(arr[0] === 0, "arr[0] should be 0, but is " + arr[0]);
+    assert(arr[1] === 2147483648, "arr[1] should be 2147483648, but is " + arr[1]);
+    assert(arr.length === 2, "Length should be 2, but is " + arr.length);
+
+    arr.shift();
+
+    assert(arr[0] === 2147483648, "arr[0] should be 2147483648, but is " + arr[0]);
+    assert(arr[1] === undefined, "arr[1] should be undefined, but is " + arr[1]);
+    assert(arr.length === 1, "Length should be 2, but is " + arr.length);
+
+    arr[1] = 1;
+
+    assert(arr[0] === 2147483648, "arr[0] should be 2147483648, but is " + arr[0]);
+    assert(arr[1] === 1, "arr[1] should be 1, but is " + arr[1]);
+    assert(arr.length === 2, "Length should be 2, but is " + arr.length);
+}
+
+for (let i = 0; i < 10000; i++)
+    test();
+
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to