@@ -56,6 +56,12 @@ static void php_object_property_dump(zend_property_info *prop_info, zval *zv, ze
5656{
5757 const char * prop_name , * class_name ;
5858
59+ #ifdef ZEND_CHECK_STACK_LIMIT
60+ if (UNEXPECTED (zend_call_stack_overflowed (EG (stack_limit )))) {
61+ php_printf ("%*cnesting level too deep" , level + 1 , ' ' );
62+ return ;
63+ }
64+ #endif
5965 if (key == NULL ) { /* numeric key */
6066 php_printf ("%*c[" ZEND_LONG_FMT "]=>\n" , level + 1 , ' ' , index );
6167 } else { /* string key */
@@ -80,7 +86,7 @@ static void php_object_property_dump(zend_property_info *prop_info, zval *zv, ze
8086 ZEND_ASSERT (ZEND_TYPE_IS_SET (prop_info -> type ));
8187 zend_string * type_str = zend_type_to_string (prop_info -> type );
8288 php_printf ("%*cuninitialized(%s)\n" ,
83- level + 1 , ' ' , ZSTR_VAL (type_str ));
89+ level + 1 , ' ' , ZSTR_VAL (type_str ));
8490 zend_string_release (type_str );
8591 } else {
8692 php_var_dump (zv , level + 2 );
@@ -718,6 +724,17 @@ PHP_FUNCTION(var_export)
718724}
719725/* }}} */
720726
727+ static zend_always_inline bool php_serialize_check_stack_limit (void )
728+ {
729+ #ifdef ZEND_CHECK_STACK_LIMIT
730+ if (UNEXPECTED (zend_call_stack_overflowed (EG (stack_limit )))) {
731+ zend_call_stack_size_error ();
732+ return true;
733+ }
734+ #endif
735+ return false;
736+ }
737+
721738static void php_var_serialize_intern (smart_str * buf , zval * struc , php_serialize_data_t var_hash , bool in_rcn_array , bool is_root );
722739
723740/**
@@ -1029,17 +1046,6 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, HashTable *ht,
10291046}
10301047/* }}} */
10311048
1032- static zend_always_inline bool php_serialize_check_stack_limit (void )
1033- {
1034- #ifdef ZEND_CHECK_STACK_LIMIT
1035- if (UNEXPECTED (zend_call_stack_overflowed (EG (stack_limit )))) {
1036- zend_call_stack_size_error ();
1037- return true;
1038- }
1039- #endif
1040- return false;
1041- }
1042-
10431049static void php_var_serialize_intern (smart_str * buf , zval * struc , php_serialize_data_t var_hash , bool in_rcn_array , bool is_root ) /* {{{ */
10441050{
10451051 zend_long var_already ;
0 commit comments