Skip to content

Commit 4725a72

Browse files
committed
Fix ZTS initialization
1 parent 8032d70 commit 4725a72

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Zend/zend.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -849,10 +849,8 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals) /* {{
849849
executor_globals->record_errors = false;
850850
executor_globals->num_errors = 0;
851851
executor_globals->errors = NULL;
852-
853-
# ifdef ZEND_CHECK_STACK_LIMIT
854-
zend_call_stack_init();
855-
# endif
852+
executor_globals->stack_limit = (void*)0;
853+
executor_globals->stack_base = (void*)0;
856854
}
857855
/* }}} */
858856

@@ -874,6 +872,7 @@ static void zend_new_thread_end_handler(THREAD_T thread_id) /* {{{ */
874872
{
875873
zend_copy_ini_directives();
876874
zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP);
875+
zend_call_stack_init();
877876
}
878877
/* }}} */
879878
#endif
@@ -1132,9 +1131,10 @@ zend_result zend_post_startup(void) /* {{{ */
11321131
zend_copy_ini_directives();
11331132
#else
11341133
global_map_ptr_last = CG(map_ptr_last);
1135-
# ifdef ZEND_CHECK_STACK_LIMIT
1134+
#endif
1135+
1136+
#ifdef ZEND_CHECK_STACK_LIMIT
11361137
zend_call_stack_init();
1137-
# endif
11381138
#endif
11391139

11401140
return SUCCESS;

0 commit comments

Comments
 (0)