com php-src: Fixed Bug #76942 U_ARGUMENT_TYPE_MISMATCH: ext/intl/msgformat/msgformat_helpers.cpp ext/intl/test s/bug74484_MessageFormatter.phpt
| From: | Anatol Belski | Date: | Fri, 05 Oct 2018 20:50:34 +0000 |
| Subject: | com php-src: Fixed Bug #76942 U_ARGUMENT_TYPE_MISMATCH: ext/intl/msgformat/msgformat_helpers.cpp ext/intl/test s/bug74484_MessageFormatter.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-103365@lists.php.net to get a copy of this message | ||
Commit: 534684d1042978f3c21caf9b665a7aca27f3f325
Author: Anatol Belski <ab@php.net> Fri, 5 Oct 2018 22:50:34 +0200
Parents: bb4a2e8bb7fc80fa5b3725508bcc8fea525f059b
Branches: PHP-7.1 PHP-7.2 PHP-7.3 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=534684d1042978f3c21caf9b665a7aca27f3f325
Log:
Fixed Bug #76942 U_ARGUMENT_TYPE_MISMATCH
ref bug #74484
Bugs:
https://bugs.php.net/76942
https://bugs.php.net/74484
Changed paths:
M ext/intl/msgformat/msgformat_helpers.cpp
M ext/intl/tests/bug74484_MessageFormatter.phpt
Diff:
diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index 29956c7..25fa3e5 100644
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -46,6 +46,7 @@ extern "C" {
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48
#define HAS_MESSAGE_PATTERN 1
+#define HAS_MISALLOCATE_MEMORY_BUG 1
#endif
U_NAMESPACE_BEGIN
@@ -334,6 +335,7 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
return; /* already done */
}
+#ifdef HAS_MISALLOCATE_MEMORY_BUG
/* There is a bug in ICU which prevents MessageFormatter::getFormats()
to handle more than 10 formats correctly. The enumerator could be
used to walk through the present formatters using getFormat(), which
@@ -351,6 +353,7 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
if (count > 10) {
return;
}
+#endif
formats = mf->getFormats(count);
diff --git a/ext/intl/tests/bug74484_MessageFormatter.phpt
b/ext/intl/tests/bug74484_MessageFormatter.phpt
index b48de33..d3b29a5 100644
--- a/ext/intl/tests/bug74484_MessageFormatter.phpt
+++ b/ext/intl/tests/bug74484_MessageFormatter.phpt
@@ -4,6 +4,8 @@ Bug #74484 MessageFormatter::formatMessage memory corruption with 11+ named plac
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
+if (version_compare(INTL_ICU_VERSION, '4.8') < 0)
+ die('skip for ICU 4.8+');
?>
--FILE--
<?php