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

Issue 1350913005: Don't crash when preparsing destructured arguments (Closed)

Created:
5 years, 3 months ago by adamk
Modified:
5 years, 3 months ago
Reviewers:
caitp (gmail), rossberg
CC:
v8-reviews_googlegroups.com, wingo
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Don't crash when preparsing destructured arguments This adds the materialized literal count accumulated while parsing the parameters (in the parser proper) to that accumulated by the preparser. This should have been caught in cctest/test-parsing, but it's not covered because the parsing tests call directly into the preparser rather than using Parser::ParseFunctionLiteral (which fully-parses the parameters and then calls into the preparser to skip over the function body). Note that this further-inflates the materialized literal count for functions with destructured arguments, since some of the counted literals are actually binding patterns. But that's not specific to binding patterns in formal parameters: it happens in function bodies, too. BUG=v8:4400, v8:4407 LOG=n Committed: https://crrev.com/7485da7ace55cf4318f0a3a02a54fed04bed2a7a Cr-Commit-Position: refs/heads/master@{#30868}

Patch Set 1 #

Total comments: 3

Patch Set 2 : Always add counts #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -7 lines) Patch
M src/parser.cc View 1 1 chunk +2 lines, -3 lines 0 comments Download
A + test/mjsunit/harmony/regress/regress-4400.js View 1 chunk +3 lines, -4 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
adamk
5 years, 3 months ago (2015-09-18 21:24:31 UTC) #2
caitp (gmail)
Looks okay to me https://codereview.chromium.org/1350913005/diff/1/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1350913005/diff/1/src/parser.cc#newcode4203 src/parser.cc:4203: if (function_state.materialized_literal_count() > 0) { ...
5 years, 3 months ago (2015-09-18 21:30:09 UTC) #3
caitp (gmail)
https://codereview.chromium.org/1350913005/diff/1/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1350913005/diff/1/src/parser.cc#newcode4203 src/parser.cc:4203: if (function_state.materialized_literal_count() > 0) { On 2015/09/18 21:30:08, caitp ...
5 years, 3 months ago (2015-09-18 21:38:17 UTC) #4
adamk
https://codereview.chromium.org/1350913005/diff/1/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1350913005/diff/1/src/parser.cc#newcode4203 src/parser.cc:4203: if (function_state.materialized_literal_count() > 0) { On 2015/09/18 21:38:16, caitp ...
5 years, 3 months ago (2015-09-18 23:23:03 UTC) #5
rossberg
lgtm
5 years, 3 months ago (2015-09-22 15:28:15 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1350913005/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1350913005/20001
5 years, 3 months ago (2015-09-22 17:19:11 UTC) #8
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 3 months ago (2015-09-22 17:43:31 UTC) #9
commit-bot: I haz the power
5 years, 3 months ago (2015-09-22 17:43:54 UTC) #10
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/7485da7ace55cf4318f0a3a02a54fed04bed2a7a
Cr-Commit-Position: refs/heads/master@{#30868}

Powered by Google App Engine
This is Rietveld 408576698