mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix regression on platforms without ZEND_CHECK_STACK_LIMIT set (8.4) (#16285)
The check called an API only available with this def set. Gate the check behind ifdef and change control flow to better fit it. Co-authored-by: Arnaud Le Blanc <arnaud.lb@gmail.com>
This commit is contained in:
@@ -1036,10 +1036,12 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, HashTable *ht,
|
|||||||
static zend_always_inline bool php_serialize_check_stack_limit(void)
|
static zend_always_inline bool php_serialize_check_stack_limit(void)
|
||||||
{
|
{
|
||||||
#ifdef ZEND_CHECK_STACK_LIMIT
|
#ifdef ZEND_CHECK_STACK_LIMIT
|
||||||
return zend_call_stack_overflowed(EG(stack_limit));
|
if (UNEXPECTED(zend_call_stack_overflowed(EG(stack_limit)))) {
|
||||||
#else
|
zend_call_stack_size_error();
|
||||||
return false;
|
return true;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash, bool in_rcn_array, bool is_root) /* {{{ */
|
static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash, bool in_rcn_array, bool is_root) /* {{{ */
|
||||||
@@ -1052,7 +1054,6 @@ static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (UNEXPECTED(php_serialize_check_stack_limit())) {
|
if (UNEXPECTED(php_serialize_check_stack_limit())) {
|
||||||
zend_call_stack_size_error();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user