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

Unified Diff: src/regexp/regexp-parser.cc

Issue 1884143002: [regexp] fix assertion failure when parsing close to stack overflow. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | test/mjsunit/regress/regress-crbug-600257.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp/regexp-parser.cc
diff --git a/src/regexp/regexp-parser.cc b/src/regexp/regexp-parser.cc
index 8a9e2a81c114dcc49fb1cae46e0e2ac07afa4567..0481c838c6f1781cee66bd45064a3fa64b5a67e4 100644
--- a/src/regexp/regexp-parser.cc
+++ b/src/regexp/regexp-parser.cc
@@ -130,6 +130,7 @@ bool RegExpParser::IsSyntaxCharacterOrSlash(uc32 c) {
RegExpTree* RegExpParser::ReportError(Vector<const char> message) {
+ if (failed_) return NULL; // Do not overwrite any existing error.
failed_ = true;
*error_ = isolate()->factory()->NewStringFromAscii(message).ToHandleChecked();
// Zip to the end to make sure the no more input is read.
@@ -511,9 +512,8 @@ RegExpTree* RegExpParser::ParseDisjunction() {
break;
case '{': {
int dummy;
- if (ParseIntervalQuantifier(&dummy, &dummy)) {
- return ReportError(CStrVector("Nothing to repeat"));
- }
+ bool parsed = ParseIntervalQuantifier(&dummy, &dummy CHECK_FAILED);
+ if (parsed) return ReportError(CStrVector("Nothing to repeat"));
// fallthrough
}
case '}':
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-600257.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698