@@ -179,9 +179,9 @@ static ZEND_INI_MH(OnUpdateMaxAllowedStackSize) /* {{{ */
179179{
180180 zend_long size = zend_ini_parse_quantity_warn (new_value , entry -> name );
181181
182- if (size < ZEND_MAX_ALLOWED_STACK_USAGE_UNCHECKED ) {
182+ if (size < ZEND_MAX_ALLOWED_STACK_SIZE_UNCHECKED ) {
183183 zend_error (E_WARNING , "Invalid \"%s\" setting. Value must be >= %d, but got " ZEND_LONG_FMT ,
184- ZSTR_VAL (entry -> name ), ZEND_MAX_ALLOWED_STACK_USAGE_UNCHECKED , size );
184+ ZSTR_VAL (entry -> name ), ZEND_MAX_ALLOWED_STACK_SIZE_UNCHECKED , size );
185185 return FAILURE ;
186186 }
187187
@@ -252,9 +252,9 @@ ZEND_INI_BEGIN()
252252 STD_ZEND_INI_ENTRY ("fiber.stack_size" , NULL , ZEND_INI_ALL , OnUpdateFiberStackSize , fiber_stack_size , zend_executor_globals , executor_globals )
253253#ifdef ZEND_CHECK_STACK_LIMIT
254254 /* The maximum allowed call stack size. 0: auto detect, -1: no limit. For fibers, this is fiber.stack_size. */
255- STD_ZEND_INI_ENTRY ("zend.max_allowed_stack_size" , "0" , ZEND_INI_PERDIR , OnUpdateMaxAllowedStackSize , max_allowed_stack_size , zend_executor_globals , executor_globals )
255+ STD_ZEND_INI_ENTRY ("zend.max_allowed_stack_size" , "0" , ZEND_INI_SYSTEM , OnUpdateMaxAllowedStackSize , max_allowed_stack_size , zend_executor_globals , executor_globals )
256256 /* Substracted from the max allowed stack size, as a buffer, when checking for overflow. 0: auto detect. */
257- STD_ZEND_INI_ENTRY ("zend.reserved_stack_size" , "0" , ZEND_INI_PERDIR , OnUpdateReservedStackSize , reserved_stack_size , zend_executor_globals , executor_globals )
257+ STD_ZEND_INI_ENTRY ("zend.reserved_stack_size" , "0" , ZEND_INI_SYSTEM , OnUpdateReservedStackSize , reserved_stack_size , zend_executor_globals , executor_globals )
258258#endif
259259
260260ZEND_INI_END ()
@@ -851,10 +851,8 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals) /* {{
851851 executor_globals -> errors = NULL ;
852852
853853# ifdef ZEND_CHECK_STACK_LIMIT
854- if (!zend_call_stack_get (& executor_globals -> call_stack )) {
855- executor_globals -> call_stack = (zend_call_stack ){0 };
856- }
857- # endif /* ZEND_CHECK_STACK_LIMIT */
854+ zend_call_stack_init ();
855+ # endif
858856}
859857/* }}} */
860858
@@ -1041,12 +1039,6 @@ void zend_startup(zend_utility_functions *utility_functions) /* {{{ */
10411039 CG (map_ptr_base ) = ZEND_MAP_PTR_BIASED_BASE (NULL );
10421040 CG (map_ptr_size ) = 0 ;
10431041 CG (map_ptr_last ) = 0 ;
1044-
1045- # ifdef ZEND_CHECK_STACK_LIMIT
1046- if (!zend_call_stack_get (& EG (call_stack ))) {
1047- EG (call_stack ) = (zend_call_stack ){0 };
1048- }
1049- # endif /* ZEND_CHECK_STACK_LIMIT */
10501042#endif /* ZTS */
10511043 EG (error_reporting ) = E_ALL & ~E_NOTICE ;
10521044
@@ -1140,6 +1132,9 @@ zend_result zend_post_startup(void) /* {{{ */
11401132 zend_copy_ini_directives ();
11411133#else
11421134 global_map_ptr_last = CG (map_ptr_last );
1135+ # ifdef ZEND_CHECK_STACK_LIMIT
1136+ zend_call_stack_init ();
1137+ # endif
11431138#endif
11441139
11451140 return SUCCESS ;
0 commit comments