Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Issue 1428483002: Check that array length stays a safe integer in Array.prototype.push (Closed)

Created:
5 years, 1 month ago by Dan Ehrenberg
Modified:
5 years, 1 month ago
Reviewers:
adamk
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Check that array length stays a safe integer in Array.prototype.push This patch adds a check in Array.prototype.push to assert that the new length does not become greater than 2**53-1. Such a length would be dangerous because integer arithmetic becomes imprecise after the boundary. The check is also required by a test262 test. R=adamk LOG=Y BUG=v8:3087 Committed: https://crrev.com/e68adf4548dd101dc08fcbff14444152fb1b7fe7 Cr-Commit-Position: refs/heads/master@{#31588}

Patch Set 1 #

Patch Set 2 : Error should be a TypeError, not a RangeError #

Total comments: 6

Patch Set 3 : fix test and improve comments #

Total comments: 2

Patch Set 4 : Remove comparison to 2**32 #

Patch Set 5 : fix comparison #

Patch Set 6 : Fix check #

Patch Set 7 : Use 2**30 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -7 lines) Patch
M src/js/array.js View 1 2 3 4 5 6 1 chunk +9 lines, -0 lines 0 comments Download
M src/messages.h View 1 chunk +3 lines, -0 lines 0 comments Download
M test/mjsunit/harmony/array-length.js View 1 2 1 chunk +1 line, -7 lines 0 comments Download

Messages

Total messages: 34 (13 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1428483002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1428483002/1
5 years, 1 month ago (2015-10-26 20:02:34 UTC) #2
Dan Ehrenberg
5 years, 1 month ago (2015-10-26 20:02:49 UTC) #4
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_linux64_avx2_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_avx2_rel/builds/5777)
5 years, 1 month ago (2015-10-26 20:13:06 UTC) #6
adamk
https://codereview.chromium.org/1428483002/diff/20001/src/js/array.js File src/js/array.js (right): https://codereview.chromium.org/1428483002/diff/20001/src/js/array.js#newcode520 src/js/array.js:520: // The length of arguments can never be more ...
5 years, 1 month ago (2015-10-26 21:21:03 UTC) #7
Dan Ehrenberg
https://codereview.chromium.org/1428483002/diff/20001/src/js/array.js File src/js/array.js (right): https://codereview.chromium.org/1428483002/diff/20001/src/js/array.js#newcode520 src/js/array.js:520: // The length of arguments can never be more ...
5 years, 1 month ago (2015-10-26 22:59:32 UTC) #8
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1428483002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1428483002/40001
5 years, 1 month ago (2015-10-26 22:59:44 UTC) #10
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_mac_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_mac_rel/builds/11144)
5 years, 1 month ago (2015-10-26 23:09:53 UTC) #12
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1428483002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1428483002/60001
5 years, 1 month ago (2015-10-26 23:13:22 UTC) #14
adamk
https://codereview.chromium.org/1428483002/diff/40001/src/js/array.js File src/js/array.js (right): https://codereview.chromium.org/1428483002/diff/40001/src/js/array.js#newcode525 src/js/array.js:525: if (m > 1 << 32 || (n - ...
5 years, 1 month ago (2015-10-26 23:14:28 UTC) #15
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1428483002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1428483002/80001
5 years, 1 month ago (2015-10-26 23:26:41 UTC) #17
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_mac_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_mac_rel/builds/11146)
5 years, 1 month ago (2015-10-26 23:36:25 UTC) #19
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1428483002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1428483002/100001
5 years, 1 month ago (2015-10-26 23:56:24 UTC) #21
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_linux64_avx2_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_avx2_rel/builds/5783)
5 years, 1 month ago (2015-10-27 00:05:13 UTC) #23
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1428483002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1428483002/120001
5 years, 1 month ago (2015-10-27 00:32:01 UTC) #25
Dan Ehrenberg
https://codereview.chromium.org/1428483002/diff/40001/src/js/array.js File src/js/array.js (right): https://codereview.chromium.org/1428483002/diff/40001/src/js/array.js#newcode525 src/js/array.js:525: if (m > 1 << 32 || (n - ...
5 years, 1 month ago (2015-10-27 00:47:36 UTC) #26
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 1 month ago (2015-10-27 00:57:25 UTC) #28
adamk
lgtm
5 years, 1 month ago (2015-10-27 01:11:43 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1428483002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1428483002/120001
5 years, 1 month ago (2015-10-27 01:13:14 UTC) #31
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 1 month ago (2015-10-27 04:39:05 UTC) #32
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/e68adf4548dd101dc08fcbff14444152fb1b7fe7 Cr-Commit-Position: refs/heads/master@{#31588}
5 years, 1 month ago (2015-10-27 04:39:34 UTC) #33
Dan Ehrenberg
5 years, 1 month ago (2015-10-27 05:45:28 UTC) #34
Message was sent while issue was closed.
A revert of this CL (patchset #7 id:120001) has been created in
https://codereview.chromium.org/1418093007/ by littledan@chromium.org.

The reason for reverting is: Caused for-in-opt test to fail.

Powered by Google App Engine
This is Rietveld 408576698