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

Unified Diff: src/regexp/jsregexp.cc

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 | « no previous file | src/regexp/regexp-ast.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp/jsregexp.cc
diff --git a/src/regexp/jsregexp.cc b/src/regexp/jsregexp.cc
index 3fe46b7390b2572ef60bd254ceeb83d1e79f667d..fe04fbc9cff40f6f9e31f1f01bc33bf39990ec9e 100644
--- a/src/regexp/jsregexp.cc
+++ b/src/regexp/jsregexp.cc
@@ -5159,8 +5159,10 @@ RegExpNode* RegExpCharacterClass::ToNode(RegExpCompiler* compiler,
ranges = negated;
}
if (ranges->length() == 0) {
- // No matches possible.
- return new (zone) EndNode(EndNode::BACKTRACK, zone);
+ ranges->Add(CharacterRange::Everything(), zone);
+ RegExpCharacterClass* fail =
+ new (zone) RegExpCharacterClass(ranges, true);
+ return new (zone) TextNode(fail, compiler->read_backward(), on_success);
}
if (standard_type() == '*') {
return UnanchoredAdvance(compiler, on_success);
« no previous file with comments | « no previous file | src/regexp/regexp-ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698