Bug 1466471 - Part 6: Import patch to fix case conversion bug. r=Waldo
authorAndré Bargull <andre.bargull@gmail.com>
Thu, 05 Jul 2018 07:14:07 -0700
changeset 425604 7c84b1a609df6211310a7b50a2f7a6b5e310143a
parent 425603 dce28e8cfcd69be78f6ecc48a909eb94c75a1b6a
child 425605 4a310672bb05b550e2b54da2c7dfc459aff488b0
push id34261
push userapavel@mozilla.com
push dateTue, 10 Jul 2018 16:35:10 +0000
treeherdermozilla-central@9302fd8c95c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs1466471
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1466471 - Part 6: Import patch to fix case conversion bug. r=Waldo
intl/icu-patches/bug-1466471-case-conversion-bugfix.diff
intl/icu/source/common/ucase.cpp
intl/update-icu.sh
new file mode 100644
--- /dev/null
+++ b/intl/icu-patches/bug-1466471-case-conversion-bugfix.diff
@@ -0,0 +1,41 @@
+https://ssl.icu-project.org/trac/ticket/13851
+
+Index: source/common/ucase.cpp
+===================================================================
+--- a/intl/icu/source/common/ucase.cpp	(Revision 41549)
++++ b/intl/icu/source/common/ucase.cpp	(Revision 41550)
+@@ -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)) {
--- a/intl/icu/source/common/ucase.cpp
+++ b/intl/icu/source/common/ucase.cpp
@@ -265,16 +265,17 @@ ucase_addCaseClosure(UChar32 c, const US
         for(idx=UCASE_EXC_LOWER; idx<=UCASE_EXC_TITLE; ++idx) {
             if(HAS_SLOT(excWord, idx)) {
                 pe=pe0;
                 GET_SLOT_VALUE(excWord, idx, pe, c);
                 sa->add(sa->set, c);
             }
         }
         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);
         }
 
         /* get the closure string pointer & length */
         if(HAS_SLOT(excWord, UCASE_EXC_CLOSURE)) {
             pe=pe0;
@@ -1162,17 +1163,17 @@ ucase_toFullLower(UChar32 c,
 
                 /* return the string length */
                 return full;
             }
         }
 
         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)) {
             GET_SLOT_VALUE(excWord, UCASE_EXC_LOWER, pe2, result);
         }
     }
 
     return (result==c) ? ~result : result;
@@ -1256,17 +1257,17 @@ toUpperOrTitle(UChar32 c,
 
                 /* return the string length */
                 return full;
             }
         }
 
         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)) {
             idx=UCASE_EXC_TITLE;
         } else if(HAS_SLOT(excWord, UCASE_EXC_UPPER)) {
             /* here, titlecase is same as uppercase */
             idx=UCASE_EXC_UPPER;
         } else {
@@ -1464,17 +1465,17 @@ ucase_toFullFolding(UChar32 c,
             }
         }
 
         if((excWord&UCASE_EXC_NO_SIMPLE_CASE_FOLDING)!=0) {
             return ~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)) {
             idx=UCASE_EXC_FOLD;
         } else if(HAS_SLOT(excWord, UCASE_EXC_LOWER)) {
             idx=UCASE_EXC_LOWER;
         } else {
             return ~c;
--- a/intl/update-icu.sh
+++ b/intl/update-icu.sh
@@ -65,16 +65,17 @@ find ${icu_dir}/source/data/zone \
 # the tree.)
 svn info $1 | grep -v '^Revision: [[:digit:]]\+$' > ${icu_dir}/SVN-INFO
 
 for patch in \
  bug-915735 \
  suppress-warnings.diff \
  bug-1172609-timezone-recreateDefault.diff \
  bug-1198952-workaround-make-3.82-bug.diff \
+ bug-1466471-case-conversion-bugfix.diff \
 ; do
   echo "Applying local patch $patch"
   patch -d ${icu_dir}/../../ -p1 --no-backup-if-mismatch < ${icu_dir}/../icu-patches/$patch
 done
 
 topsrcdir=`dirname $0`/../
 python ${topsrcdir}/js/src/tests/non262/String/make-normalize-generateddata-input.py $topsrcdir