Index: src/regexp/regexp-parser.cc |
diff --git a/src/regexp/regexp-parser.cc b/src/regexp/regexp-parser.cc |
index 1e6a0dacca638881cabf0470bf2798c0c53bc0cb..250d03462906b046c1f66c63500bd4e2714cf43a 100644 |
--- a/src/regexp/regexp-parser.cc |
+++ b/src/regexp/regexp-parser.cc |
@@ -1294,7 +1294,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); |