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

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

Issue 1811913006: [regexp] catch stack overflow when parsing back references. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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-595657.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 0df12dcbab7e73357571665090183876092275c6..6db8d04defbd69449e60d970b8881528e2497909 100644
--- a/src/regexp/regexp-parser.cc
+++ b/src/regexp/regexp-parser.cc
@@ -387,7 +387,8 @@ RegExpTree* RegExpParser::ParseDisjunction() {
case '8':
case '9': {
int index = 0;
- if (ParseBackReferenceIndex(&index)) {
+ bool is_backref = ParseBackReferenceIndex(&index CHECK_FAILED);
+ if (is_backref) {
if (state->IsInsideCaptureGroup(index)) {
// The back reference is inside the capture group it refers to.
// Nothing can possibly have been captured yet, so we use empty
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-595657.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698