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

Issue 1431503002: Avoid creating indexed elements at index maxUint32 (Closed)

Created:
5 years, 1 month ago by Dan Ehrenberg
Modified:
5 years, 1 month ago
Reviewers:
adamk, Jakob Kummerow
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

Avoid creating indexed elements at index maxUint32 The maximum indexed element size is maxUint32-1, not maxUint32, because the maximum length of elements is maxUint32. This patch tweaks the limit to switch to named properties as appropriate. BUG=v8:4516 LOG=Y R=adamk Committed: https://crrev.com/755fcc5fc63dc48a5bf18dee5c3d59de79471a11 Cr-Commit-Position: refs/heads/master@{#31809}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Use Jakob's suggestion for a more robust check #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -1 line) Patch
M src/js/macros.py View 1 chunk +3 lines, -0 lines 0 comments Download
M src/js/runtime.js View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 21 (6 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/1431503002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1431503002/1
5 years, 1 month ago (2015-10-29 21:45:43 UTC) #2
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 1 month ago (2015-10-29 22:05:50 UTC) #4
Dan Ehrenberg
5 years, 1 month ago (2015-10-30 00:48:23 UTC) #6
Jakob Kummerow
DBC. https://codereview.chromium.org/1431503002/diff/1/src/js/runtime.js File src/js/runtime.js (right): https://codereview.chromium.org/1431503002/diff/1/src/js/runtime.js#newcode213 src/js/runtime.js:213: if (index < kMaxUint32) { How do you ...
5 years, 1 month ago (2015-10-30 09:38:05 UTC) #7
Dan Ehrenberg
On 2015/10/30 at 09:38:05, jkummerow wrote: > DBC. > > https://codereview.chromium.org/1431503002/diff/1/src/js/runtime.js > File src/js/runtime.js (right): ...
5 years, 1 month ago (2015-11-02 18:15:52 UTC) #8
Jakob Kummerow
On 2015/11/02 18:15:52, Dan Ehrenberg wrote: > same as before this patch. Nope, that's my ...
5 years, 1 month ago (2015-11-03 10:17:22 UTC) #9
Dan Ehrenberg
On 2015/11/03 at 10:17:22, jkummerow wrote: > On 2015/11/02 18:15:52, Dan Ehrenberg wrote: > > ...
5 years, 1 month ago (2015-11-04 17:18:19 UTC) #10
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1431503002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1431503002/20001
5 years, 1 month ago (2015-11-04 18:42:46 UTC) #12
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 1 month ago (2015-11-04 19:18:51 UTC) #14
Dan Ehrenberg
On 2015/11/04 at 17:18:19, Dan Ehrenberg wrote: > On 2015/11/03 at 10:17:22, jkummerow wrote: > ...
5 years, 1 month ago (2015-11-04 20:10:03 UTC) #15
adamk
lgtm given that you've done exactly what jkummerow asked for
5 years, 1 month ago (2015-11-05 00:21:59 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1431503002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1431503002/20001
5 years, 1 month ago (2015-11-05 00:41:59 UTC) #18
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 1 month ago (2015-11-05 00:43:32 UTC) #19
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/755fcc5fc63dc48a5bf18dee5c3d59de79471a11 Cr-Commit-Position: refs/heads/master@{#31809}
5 years, 1 month ago (2015-11-05 00:43:56 UTC) #20
Jakob Kummerow
5 years, 1 month ago (2015-11-09 10:39:58 UTC) #21
Message was sent while issue was closed.
LGTM, thanks.

On 2015/11/04 17:18:19, Dan Ehrenberg wrote:
> Previously, callers just called out to %AddElement directly. How did that
handle
> careless callsites? I think it would just check-fail there. I can use this
> pattern but I don't see what the problem is exactly.

What I meant was: before this CL and with patch set 2, when someone calls
AddIndexedProperty with index == -1 (or any other negative integer value,
really), the %AddNamedProperty path will be taken, which is correct. With patch
set 1, %AddElement would have been called, which in turn would crash in
"CHECK(key->ToArrayIndex(&index));".

Powered by Google App Engine
This is Rietveld 408576698