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

Unified Diff: src/regexp/regexp-ast.h

Issue 1916763002: [regexp] Fix non-match and max match length in RegExpCharacterClass. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix 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 | « src/regexp/jsregexp.cc ('k') | test/mjsunit/regress/regress-crbug-605862.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp/regexp-ast.h
diff --git a/src/regexp/regexp-ast.h b/src/regexp/regexp-ast.h
index 0e718d3b4d15ecda1e6d56b3bc326ae5539a80e3..39c9ceea4ea275c879205b1b24884a2f1fccd43c 100644
--- a/src/regexp/regexp-ast.h
+++ b/src/regexp/regexp-ast.h
@@ -296,7 +296,10 @@ class RegExpCharacterClass final : public RegExpTree {
bool IsCharacterClass() override;
bool IsTextElement() override { return true; }
int min_match() override { return 1; }
- int max_match() override { return 1; }
+ // The character class may match two code units for unicode regexps.
+ // TODO(yangguo): we should split this class for usage in TextElement, and
+ // make max_match() dependent on the character class content.
+ int max_match() override { return 2; }
void AppendToText(RegExpText* text, Zone* zone) override;
CharacterSet character_set() { return set_; }
// TODO(lrn): Remove need for complex version if is_standard that
« no previous file with comments | « src/regexp/jsregexp.cc ('k') | test/mjsunit/regress/regress-crbug-605862.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698