diff --git a/deps/icu-small/source/common/unicode/utfiterator.h b/deps/icu-small/source/common/unicode/utfiterator.h index 7e9fc4ba314d52..6e79a4403057ad 100644 --- a/deps/icu-small/source/common/unicode/utfiterator.h +++ b/deps/icu-small/source/common/unicode/utfiterator.h @@ -557,9 +557,11 @@ class UTFImpl< public: // Handle ill-formed UTF-8 U_FORCE_INLINE static CP32 sub() { - switch (behavior) { - case UTF_BEHAVIOR_NEGATIVE: return U_SENTINEL; - case UTF_BEHAVIOR_FFFD: return 0xfffd; + if constexpr (behavior == UTF_BEHAVIOR_NEGATIVE) { + return U_SENTINEL; + } else { + static_assert(behavior == UTF_BEHAVIOR_FFFD); + return 0xfffd; } } @@ -736,10 +738,13 @@ class UTFImpl< public: // Handle ill-formed UTF-16: One unpaired surrogate. U_FORCE_INLINE static CP32 sub(CP32 surrogate) { - switch (behavior) { - case UTF_BEHAVIOR_NEGATIVE: return U_SENTINEL; - case UTF_BEHAVIOR_FFFD: return 0xfffd; - case UTF_BEHAVIOR_SURROGATE: return surrogate; + if constexpr (behavior == UTF_BEHAVIOR_NEGATIVE) { + return U_SENTINEL; + } else if constexpr (behavior == UTF_BEHAVIOR_FFFD) { + return 0xfffd; + } else { + static_assert(behavior == UTF_BEHAVIOR_SURROGATE); + return surrogate; } } @@ -822,10 +827,13 @@ class UTFImpl< public: // Handle ill-formed UTF-32 U_FORCE_INLINE static CP32 sub(bool forSurrogate, CP32 surrogate) { - switch (behavior) { - case UTF_BEHAVIOR_NEGATIVE: return U_SENTINEL; - case UTF_BEHAVIOR_FFFD: return 0xfffd; - case UTF_BEHAVIOR_SURROGATE: return forSurrogate ? surrogate : 0xfffd; + if constexpr (behavior == UTF_BEHAVIOR_NEGATIVE) { + return U_SENTINEL; + } else if constexpr (behavior == UTF_BEHAVIOR_FFFD) { + return 0xfffd; + } else { + static_assert(behavior == UTF_BEHAVIOR_SURROGATE); + return forSurrogate ? surrogate : 0xfffd; } } diff --git a/deps/icu-small/source/common/unicode/uvernum.h b/deps/icu-small/source/common/unicode/uvernum.h index b5273a04fcf8d4..75acd4f0052a88 100644 --- a/deps/icu-small/source/common/unicode/uvernum.h +++ b/deps/icu-small/source/common/unicode/uvernum.h @@ -59,7 +59,7 @@ * This value will change in the subsequent releases of ICU * @stable ICU 2.6 */ -#define U_ICU_VERSION_MINOR_NUM 2 +#define U_ICU_VERSION_MINOR_NUM 3 /** The current ICU patchlevel version as an integer. * This value will change in the subsequent releases of ICU @@ -132,7 +132,7 @@ * This value will change in the subsequent releases of ICU * @stable ICU 2.4 */ -#define U_ICU_VERSION "78.2" +#define U_ICU_VERSION "78.3" /** * The current ICU library major version number as a string, for library name suffixes. @@ -151,7 +151,7 @@ /** Data version in ICU4C. * @internal ICU 4.4 Internal Use Only **/ -#define U_ICU_DATA_VERSION "78.2" +#define U_ICU_DATA_VERSION "78.3" #endif /* U_HIDE_INTERNAL_API */ /*=========================================================================== diff --git a/deps/icu-small/source/data/in/icudt78l.dat.bz2 b/deps/icu-small/source/data/in/icudt78l.dat.bz2 index 5be75974fa3edd..21ca4cef1c2acd 100644 Binary files a/deps/icu-small/source/data/in/icudt78l.dat.bz2 and b/deps/icu-small/source/data/in/icudt78l.dat.bz2 differ diff --git a/deps/icu-small/source/i18n/nfrule.cpp b/deps/icu-small/source/i18n/nfrule.cpp index 26a6e818d5a9b2..3857f9f45f2e80 100644 --- a/deps/icu-small/source/i18n/nfrule.cpp +++ b/deps/icu-small/source/i18n/nfrule.cpp @@ -158,12 +158,17 @@ NFRule::makeRules(UnicodeString& description, UnicodeString sbuf; int32_t orElseOp = description.indexOf(gVerticalLine); + uint64_t mod = util64_pow(rule1->radix, rule1->exponent); // we'll actually only split the rule into two rules if its // base value is an even multiple of its divisor (or it's one // of the special rules) + if (rule1->baseValue > 0 && rule1->radix != 0 && mod == 0) { + status = U_NUMBER_ARG_OUTOFBOUNDS_ERROR; + return; + } if ((rule1->baseValue > 0 && (rule1->radix != 0) // ICU-23109 Ensure next line won't "% 0" - && (rule1->baseValue % util64_pow(rule1->radix, rule1->exponent)) == 0) + && (rule1->baseValue % mod == 0)) || rule1->getType() == kImproperFractionRule || rule1->getType() == kDefaultRule) { diff --git a/tools/icu/current_ver.dep b/tools/icu/current_ver.dep index e3f6a6100a73bb..3d923fec865aa2 100644 --- a/tools/icu/current_ver.dep +++ b/tools/icu/current_ver.dep @@ -1,6 +1,6 @@ [ { - "url": "https://github.com/unicode-org/icu/releases/download/release-78.2/icu4c-78.2-sources.tgz", - "md5": "2bf8db43ccdc837e402ac773f17c7cf8" + "url": "https://github.com/unicode-org/icu/releases/download/release-78.3/icu4c-78.3-sources.tgz", + "md5": "a7b736b570ef0e180c96a31715a00c78" } ]