Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix persistent smart_str allocation
This commit is contained in:
Nikita Popov 2021-09-16 16:29:51 +02:00
commit e250ce64e6

View file

@ -43,7 +43,7 @@ ZEND_API void ZEND_FASTCALL smart_str_erealloc(smart_str *str, size_t len)
ZEND_API void ZEND_FASTCALL smart_str_realloc(smart_str *str, size_t len) ZEND_API void ZEND_FASTCALL smart_str_realloc(smart_str *str, size_t len)
{ {
if (UNEXPECTED(!str->s)) { if (UNEXPECTED(!str->s)) {
str->a = len <= SMART_STR_START_SIZE str->a = len <= SMART_STR_START_LEN
? SMART_STR_START_LEN ? SMART_STR_START_LEN
: SMART_STR_NEW_LEN(len); : SMART_STR_NEW_LEN(len);
str->s = zend_string_alloc(str->a, 1); str->s = zend_string_alloc(str->a, 1);