Skip to content

Commit 534684d

Browse files
committed
Fixed Bug #76942 U_ARGUMENT_TYPE_MISMATCH
ref bug #74484
1 parent bb4a2e8 commit 534684d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

ext/intl/msgformat/msgformat_helpers.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ extern "C" {
4646

4747
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48
4848
#define HAS_MESSAGE_PATTERN 1
49+
#define HAS_MISALLOCATE_MEMORY_BUG 1
4950
#endif
5051

5152
U_NAMESPACE_BEGIN
@@ -334,6 +335,7 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
334335
return; /* already done */
335336
}
336337

338+
#ifdef HAS_MISALLOCATE_MEMORY_BUG
337339
/* There is a bug in ICU which prevents MessageFormatter::getFormats()
338340
to handle more than 10 formats correctly. The enumerator could be
339341
used to walk through the present formatters using getFormat(), which
@@ -351,6 +353,7 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
351353
if (count > 10) {
352354
return;
353355
}
356+
#endif
354357

355358
formats = mf->getFormats(count);
356359

ext/intl/tests/bug74484_MessageFormatter.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Bug #74484 MessageFormatter::formatMessage memory corruption with 11+ named plac
44
<?php
55
if (!extension_loaded('intl'))
66
die('skip intl extension not enabled');
7+
if (version_compare(INTL_ICU_VERSION, '4.8') < 0)
8+
die('skip for ICU 4.8+');
79
?>
810
--FILE--
911
<?php

0 commit comments

Comments
 (0)