| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -557,9 +557,11 @@ class UTFImpl< | |||
| 557 | 557 | public: | |
| 558 | 558 | // Handle ill-formed UTF-8 | |
| 559 | 559 | U_FORCE_INLINE static CP32 sub() { | |
| 560 | - switch (behavior) { | ||
| 561 | - case UTF_BEHAVIOR_NEGATIVE: return U_SENTINEL; | ||
| 562 | - case UTF_BEHAVIOR_FFFD: return 0xfffd; | ||
| 560 | + if constexpr (behavior == UTF_BEHAVIOR_NEGATIVE) { | ||
| 561 | + return U_SENTINEL; | ||
| 562 | + } else { | ||
| 563 | + static_assert(behavior == UTF_BEHAVIOR_FFFD); | ||
| 564 | + return 0xfffd; | ||
| 563 | 565 | } | |
| 564 | 566 | } | |
| 565 | 567 | ||
@@ -736,10 +738,13 @@ class UTFImpl< | |||
| 736 | 738 | public: | |
| 737 | 739 | // Handle ill-formed UTF-16: One unpaired surrogate. | |
| 738 | 740 | U_FORCE_INLINE static CP32 sub(CP32 surrogate) { | |
| 739 | - switch (behavior) { | ||
| 740 | - case UTF_BEHAVIOR_NEGATIVE: return U_SENTINEL; | ||
| 741 | - case UTF_BEHAVIOR_FFFD: return 0xfffd; | ||
| 742 | - case UTF_BEHAVIOR_SURROGATE: return surrogate; | ||
| 741 | + if constexpr (behavior == UTF_BEHAVIOR_NEGATIVE) { | ||
| 742 | + return U_SENTINEL; | ||
| 743 | + } else if constexpr (behavior == UTF_BEHAVIOR_FFFD) { | ||
| 744 | + return 0xfffd; | ||
| 745 | + } else { | ||
| 746 | + static_assert(behavior == UTF_BEHAVIOR_SURROGATE); | ||
| 747 | + return surrogate; | ||
| 743 | 748 | } | |
| 744 | 749 | } | |
| 745 | 750 | ||
@@ -822,10 +827,13 @@ class UTFImpl< | |||
| 822 | 827 | public: | |
| 823 | 828 | // Handle ill-formed UTF-32 | |
| 824 | 829 | U_FORCE_INLINE static CP32 sub(bool forSurrogate, CP32 surrogate) { | |
| 825 | - switch (behavior) { | ||
| 826 | - case UTF_BEHAVIOR_NEGATIVE: return U_SENTINEL; | ||
| 827 | - case UTF_BEHAVIOR_FFFD: return 0xfffd; | ||
| 828 | - case UTF_BEHAVIOR_SURROGATE: return forSurrogate ? surrogate : 0xfffd; | ||
| 830 | + if constexpr (behavior == UTF_BEHAVIOR_NEGATIVE) { | ||
| 831 | + return U_SENTINEL; | ||
| 832 | + } else if constexpr (behavior == UTF_BEHAVIOR_FFFD) { | ||
| 833 | + return 0xfffd; | ||
| 834 | + } else { | ||
| 835 | + static_assert(behavior == UTF_BEHAVIOR_SURROGATE); | ||
| 836 | + return forSurrogate ? surrogate : 0xfffd; | ||
| 829 | 837 | } | |
| 830 | 838 | } | |
| 831 | 839 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -59,7 +59,7 @@ | |||
| 59 | 59 | * This value will change in the subsequent releases of ICU | |
| 60 | 60 | * @stable ICU 2.6 | |
| 61 | 61 | */ | |
| 62 | - #define U_ICU_VERSION_MINOR_NUM 2 | ||
| 62 | + #define U_ICU_VERSION_MINOR_NUM 3 | ||
| 63 | 63 | ||
| 64 | 64 | /** The current ICU patchlevel version as an integer. | |
| 65 | 65 | * This value will change in the subsequent releases of ICU | |
@@ -132,7 +132,7 @@ | |||
| 132 | 132 | * This value will change in the subsequent releases of ICU | |
| 133 | 133 | * @stable ICU 2.4 | |
| 134 | 134 | */ | |
| 135 | - #define U_ICU_VERSION "78.2" | ||
| 135 | + #define U_ICU_VERSION "78.3" | ||
| 136 | 136 | ||
| 137 | 137 | /** | |
| 138 | 138 | * The current ICU library major version number as a string, for library name suffixes. | |
@@ -151,7 +151,7 @@ | |||
| 151 | 151 | /** Data version in ICU4C. | |
| 152 | 152 | * @internal ICU 4.4 Internal Use Only | |
| 153 | 153 | **/ | |
| 154 | - #define U_ICU_DATA_VERSION "78.2" | ||
| 154 | + #define U_ICU_DATA_VERSION "78.3" | ||
| 155 | 155 | #endif /* U_HIDE_INTERNAL_API */ | |
| 156 | 156 | ||
| 157 | 157 | /*=========================================================================== | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -158,12 +158,17 @@ NFRule::makeRules(UnicodeString& description, | |||
| 158 | 158 | UnicodeString sbuf; | |
| 159 | 159 | int32_t orElseOp = description.indexOf(gVerticalLine); | |
| 160 | 160 | ||
| 161 | + uint64_t mod = util64_pow(rule1->radix, rule1->exponent); | ||
| 161 | 162 | // we'll actually only split the rule into two rules if its | |
| 162 | 163 | // base value is an even multiple of its divisor (or it's one | |
| 163 | 164 | // of the special rules) | |
| 165 | + if (rule1->baseValue > 0 && rule1->radix != 0 && mod == 0) { | ||
| 166 | + status = U_NUMBER_ARG_OUTOFBOUNDS_ERROR; | ||
| 167 | + return; | ||
| 168 | + } | ||
| 164 | 169 | if ((rule1->baseValue > 0 | |
| 165 | 170 | && (rule1->radix != 0) // ICU-23109 Ensure next line won't "% 0" | |
| 166 | - && (rule1->baseValue % util64_pow(rule1->radix, rule1->exponent)) == 0) | ||
| 171 | + && (rule1->baseValue % mod == 0)) | ||
| 167 | 172 | || rule1->getType() == kImproperFractionRule | |
| 168 | 173 | || rule1->getType() == kDefaultRule) { | |
| 169 | 174 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | [ | |
| 2 | 2 | { | |
| 3 | - "url": "https://github.com/unicode-org/icu/releases/download/release-78.2/icu4c-78.2-sources.tgz", | ||
| 4 | - "md5": "2bf8db43ccdc837e402ac773f17c7cf8" | ||
| 3 | + "url": "https://github.com/unicode-org/icu/releases/download/release-78.3/icu4c-78.3-sources.tgz", | ||
| 4 | + "md5": "a7b736b570ef0e180c96a31715a00c78" | ||
| 5 | 5 | } | |
| 6 | 6 | ] | |
| Back | FazBrowse Home | New Git URL |
0 commit comments