Fix Greek lowercasing bug
Discovered by the failure of
test262/built-ins/String/prototype/toLowerCase/special_casing
Cherry-pick an upstream fix from http://bugs.icu-project.org/trac/ticket/13851
diff --git a/README.chromium b/README.chromium
index 6ce3691..0889e4e 100644
--- a/README.chromium
+++ b/README.chromium
@@ -269,3 +269,10 @@
- upstream bugs:
https://ssl.icu-project.org/trac/ticket/13750
https://github.com/google/double-conversion/issues/66
+
+9. Cherry-pick Greek lowercase fix from the upstream
+
+ - patches/greek_lowercase.patch
+ - upstream bug (fixed in 62.2-to-be)
+ https://ssl.icu-project.org/trac/ticket/13851
+
diff --git a/patches/greek_lowercase.patch b/patches/greek_lowercase.patch
new file mode 100644
index 0000000..445ca9b
--- /dev/null
+++ b/patches/greek_lowercase.patch
@@ -0,0 +1,39 @@
+diff --git a/source/common/ucase.cpp b/source/common/ucase.cpp
+index cbd5a6ef..8414c527 100644
+--- a/source/common/ucase.cpp
++++ b/source/common/ucase.cpp
+@@ -270,6 +270,7 @@ ucase_addCaseClosure(UChar32 c, const USetAdder *sa) {
+ }
+ }
+ if(HAS_SLOT(excWord, UCASE_EXC_DELTA)) {
++ pe=pe0;
+ int32_t delta;
+ GET_SLOT_VALUE(excWord, UCASE_EXC_DELTA, pe, delta);
+ sa->add(sa->set, (excWord&UCASE_EXC_DELTA_IS_NEGATIVE)==0 ? c+delta : c-delta);
+@@ -1167,7 +1168,7 @@ ucase_toFullLower(UChar32 c,
+
+ if(HAS_SLOT(excWord, UCASE_EXC_DELTA) && UCASE_IS_UPPER_OR_TITLE(props)) {
+ int32_t delta;
+- GET_SLOT_VALUE(excWord, UCASE_EXC_DELTA, pe, delta);
++ GET_SLOT_VALUE(excWord, UCASE_EXC_DELTA, pe2, delta);
+ return (excWord&UCASE_EXC_DELTA_IS_NEGATIVE)==0 ? c+delta : c-delta;
+ }
+ if(HAS_SLOT(excWord, UCASE_EXC_LOWER)) {
+@@ -1261,7 +1262,7 @@ toUpperOrTitle(UChar32 c,
+
+ if(HAS_SLOT(excWord, UCASE_EXC_DELTA) && UCASE_GET_TYPE(props)==UCASE_LOWER) {
+ int32_t delta;
+- GET_SLOT_VALUE(excWord, UCASE_EXC_DELTA, pe, delta);
++ GET_SLOT_VALUE(excWord, UCASE_EXC_DELTA, pe2, delta);
+ return (excWord&UCASE_EXC_DELTA_IS_NEGATIVE)==0 ? c+delta : c-delta;
+ }
+ if(!upperNotTitle && HAS_SLOT(excWord, UCASE_EXC_TITLE)) {
+@@ -1469,7 +1470,7 @@ ucase_toFullFolding(UChar32 c,
+ }
+ if(HAS_SLOT(excWord, UCASE_EXC_DELTA) && UCASE_IS_UPPER_OR_TITLE(props)) {
+ int32_t delta;
+- GET_SLOT_VALUE(excWord, UCASE_EXC_DELTA, pe, delta);
++ GET_SLOT_VALUE(excWord, UCASE_EXC_DELTA, pe2, delta);
+ return (excWord&UCASE_EXC_DELTA_IS_NEGATIVE)==0 ? c+delta : c-delta;
+ }
+ if(HAS_SLOT(excWord, UCASE_EXC_FOLD)) {
diff --git a/source/common/ucase.cpp b/source/common/ucase.cpp
index cbd5a6e..8414c52 100644
--- a/source/common/ucase.cpp
+++ b/source/common/ucase.cpp
@@ -270,6 +270,7 @@
}
}
if(HAS_SLOT(excWord, UCASE_EXC_DELTA)) {
+ pe=pe0;
int32_t delta;
GET_SLOT_VALUE(excWord, UCASE_EXC_DELTA, pe, delta);
sa->add(sa->set, (excWord&UCASE_EXC_DELTA_IS_NEGATIVE)==0 ? c+delta : c-delta);
@@ -1167,7 +1168,7 @@
if(HAS_SLOT(excWord, UCASE_EXC_DELTA) && UCASE_IS_UPPER_OR_TITLE(props)) {
int32_t delta;
- GET_SLOT_VALUE(excWord, UCASE_EXC_DELTA, pe, delta);
+ GET_SLOT_VALUE(excWord, UCASE_EXC_DELTA, pe2, delta);
return (excWord&UCASE_EXC_DELTA_IS_NEGATIVE)==0 ? c+delta : c-delta;
}
if(HAS_SLOT(excWord, UCASE_EXC_LOWER)) {
@@ -1261,7 +1262,7 @@
if(HAS_SLOT(excWord, UCASE_EXC_DELTA) && UCASE_GET_TYPE(props)==UCASE_LOWER) {
int32_t delta;
- GET_SLOT_VALUE(excWord, UCASE_EXC_DELTA, pe, delta);
+ GET_SLOT_VALUE(excWord, UCASE_EXC_DELTA, pe2, delta);
return (excWord&UCASE_EXC_DELTA_IS_NEGATIVE)==0 ? c+delta : c-delta;
}
if(!upperNotTitle && HAS_SLOT(excWord, UCASE_EXC_TITLE)) {
@@ -1469,7 +1470,7 @@
}
if(HAS_SLOT(excWord, UCASE_EXC_DELTA) && UCASE_IS_UPPER_OR_TITLE(props)) {
int32_t delta;
- GET_SLOT_VALUE(excWord, UCASE_EXC_DELTA, pe, delta);
+ GET_SLOT_VALUE(excWord, UCASE_EXC_DELTA, pe2, delta);
return (excWord&UCASE_EXC_DELTA_IS_NEGATIVE)==0 ? c+delta : c-delta;
}
if(HAS_SLOT(excWord, UCASE_EXC_FOLD)) {