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); |