summaryrefslogtreecommitdiff
path: root/system/icu/islamic-calendar.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2024-08-12 00:13:03 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2024-08-12 00:13:03 -0500
commitbf5f471ea7d6c17d2341305485b953b20d62f540 (patch)
treeda656c3b2e19b5af7fa57d5bc12ffd31e0f6c631 /system/icu/islamic-calendar.patch
parentf76d1f320f3cd0c71a02ce6f4273d5220cdfa7b5 (diff)
downloadpackages-bf5f471ea7d6c17d2341305485b953b20d62f540.tar.gz
packages-bf5f471ea7d6c17d2341305485b953b20d62f540.tar.bz2
packages-bf5f471ea7d6c17d2341305485b953b20d62f540.tar.xz
packages-bf5f471ea7d6c17d2341305485b953b20d62f540.zip
system/icu: Correct Islamic calendar calculations
Upstream commit d43d216feb left an extra addition when refactoring overflow-checking maths, which caused some dates to be an erroneous year in the future from where they should have been.
Diffstat (limited to 'system/icu/islamic-calendar.patch')
-rw-r--r--system/icu/islamic-calendar.patch14
1 files changed, 14 insertions, 0 deletions
diff --git a/system/icu/islamic-calendar.patch b/system/icu/islamic-calendar.patch
new file mode 100644
index 000000000..bae9734af
--- /dev/null
+++ b/system/icu/islamic-calendar.patch
@@ -0,0 +1,14 @@
+The addition is duplicated, causing some dates to be one year off.
+
+Fixes: d43d216feb ("ICU-22633 Test and fix int32_t overflow for Calendar set")
+
+--- source/i18n/islamcal.cpp.old 2024-04-16 16:08:53.000000000 -0500
++++ source/i18n/islamcal.cpp 2024-08-12 00:03:20.102380147 -0500
+@@ -452,7 +452,6 @@
+ // This may be called by Calendar::handleComputeJulianDay with months out of the range
+ // 0..11. Need to handle that here since monthStart requires months in the range 0.11.
+ if (month > 11) {
+- eyear += (month / 12);
+ if (uprv_add32_overflow(eyear, (month / 12), &eyear)) {
+ status = U_ILLEGAL_ARGUMENT_ERROR;
+ return 0;