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

Unified Diff: src/parser.cc

Issue 802313003: RegExpParser: Fix Reset()ting to the end. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: long lines Created 6 years 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-3756.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 9cb92b3c535e79900d1782c689ac0966cef1d15b..0713b26e8b9bfb24e9c06ad5c1500754d7243ab1 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -4323,6 +4323,9 @@ void RegExpParser::Advance() {
}
} else {
current_ = kEndMarker;
+ // Advance so that position() points to 1-after-the-last-character. This is
+ // important so that Reset() to this position works correctly.
+ next_pos_ = in()->length() + 1;
has_more_ = false;
}
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-3756.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698