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

Issue 194713013: Parser: fix confusion when there are multiple errors to report. (Closed)

Created:
6 years, 9 months ago by marja
Modified:
6 years, 9 months ago
Reviewers:
Michael Starzinger
CC:
v8-dev
Visibility:
Public.

Description

Parser: fix confusion when there are multiple errors to report. (For more details, see bug.) The problem occurs when a parsing function hits a stack overflow, but still manages to return something meaningful. This happens because the call to ParserBase::Next() which hits the stack overflow will still return a valid token (the last token which we had already read), and only the next call after the stack overflow will return INVALID. So for example ParseIdentifier will still return a valid identifier even if we've hit a stack overflow. In this case, some upper recursion level might detect and report a valid syntax error, and then we bail out of the recursive descent because of the syntax error. So we end up having both stack overflow and a syntax error present. When we try to report the stack overflow after parsing (e.g., end of ParseLazy), the isolate already has the syntax error as a pending exception, and a CHECK fails. This fix suppresses the syntax errors in when a stack overflow has been detected. BUG=351335 LOG=N R=mstarzinger@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=19845

Patch Set 1 #

Patch Set 2 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -0 lines) Patch
M src/parser.cc View 2 chunks +12 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
marja
mstarzinger, ptal.
6 years, 9 months ago (2014-03-11 18:55:54 UTC) #1
Michael Starzinger
LGTM.
6 years, 9 months ago (2014-03-12 09:42:50 UTC) #2
marja
6 years, 9 months ago (2014-03-12 13:27:41 UTC) #3
Message was sent while issue was closed.
Committed patchset #2 manually as r19845 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698