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

Unified Diff: pkg/front_end/lib/src/fasta/parser/parser.dart

Issue 2671653005: Improve handling of parser stack overflows. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/error_kind.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/parser/parser.dart
diff --git a/pkg/front_end/lib/src/fasta/parser/parser.dart b/pkg/front_end/lib/src/fasta/parser/parser.dart
index b1f6f876f1c3f2fbd3f698702047c5827f418aed..b06c63a3368e7f2143abc0e3cda1ef75c999e2a9 100644
--- a/pkg/front_end/lib/src/fasta/parser/parser.dart
+++ b/pkg/front_end/lib/src/fasta/parser/parser.dart
@@ -1870,9 +1870,7 @@ class Parser {
// This happens for degenerate programs, for example, a lot of nested
// if-statements. The language test deep_nesting2_negative_test, for
// example, provokes this.
- reportRecoverableError(
- token, ErrorKind.Unspecified, {'text': 'Stack overflow'});
- return skipToEof(token);
+ return reportUnrecoverableError(token, ErrorKind.StackOverflow);
}
Token result = parseStatementX(token);
statementDepth--;
@@ -2190,9 +2188,7 @@ class Parser {
// This happens in degenerate programs, for example, with a lot of nested
// list literals. This is provoked by, for examaple, the language test
// deep_nesting1_negative_test.
- reportRecoverableError(
- token, ErrorKind.Unspecified, {'text': 'Stack overflow'});
- return token.next;
+ return reportUnrecoverableError(token, ErrorKind.StackOverflow);
}
listener.beginExpression(token);
Token result = optional('throw', token)
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/error_kind.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698