Index: src/regexp/regexp-parser.cc |
diff --git a/src/regexp/regexp-parser.cc b/src/regexp/regexp-parser.cc |
index be2cf7c42a880671c3f288d2186d4972a52ac9ff..76b2fd0bf62993a4553e151923675d46fe5a6ced 100644 |
--- a/src/regexp/regexp-parser.cc |
+++ b/src/regexp/regexp-parser.cc |
@@ -1253,7 +1253,10 @@ bool RegExpBuilder::NeedsDesugaringForUnicode(RegExpCharacterClass* cc) { |
bool RegExpBuilder::NeedsDesugaringForIgnoreCase(uc32 c) { |
#ifdef V8_I18N_SUPPORT |
- if (unicode() && ignore_case()) { |
+ if (unicode() && ignore_case() && c >= kNonBmpStart) { |
+ // BMP characters are handled in the case-insensitive TextEmitPass. |
+ // Surrogate code units do not have case equivalents. |
+ // Non-BMP characters need to be desugared into two uc16 parts. |
USet* set = uset_open(c, c); |
uset_closeOver(set, USET_CASE_INSENSITIVE); |
uset_removeAllStrings(set); |