Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES
performed on the result.
. The zend_dval_to_lval_cap() function no longer takes a second
zend_string* parameter.
. EG(in_autoload) was renamed to EG(autoload_current_classnames) and no
longer is a pointer, but a directly embedded HashTable struct.

========================
2. Build system changes
Expand Down
1 change: 0 additions & 1 deletion Zend/zend.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,6 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals) /* {{
executor_globals->user_error_handler_error_reporting = 0;
ZVAL_UNDEF(&executor_globals->user_error_handler);
ZVAL_UNDEF(&executor_globals->user_exception_handler);
executor_globals->in_autoload = NULL;
executor_globals->current_execute_data = NULL;
executor_globals->current_module = NULL;
executor_globals->exit_status = 0;
Expand Down
16 changes: 4 additions & 12 deletions Zend/zend_execute_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ void init_executor(void) /* {{{ */
EG(function_table) = CG(function_table);
EG(class_table) = CG(class_table);

EG(in_autoload) = NULL;
EG(error_handling) = EH_NORMAL;
EG(flags) = EG_FLAGS_INITIAL;

Expand All @@ -156,6 +155,7 @@ void init_executor(void) /* {{{ */
zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_activator);

zend_hash_init(&EG(included_files), 8, NULL, NULL, 0);
zend_hash_init(&EG(autoload_current_classnames), 8, NULL, NULL, 0);

EG(ticks_count) = 0;

Expand Down Expand Up @@ -503,16 +503,13 @@ void shutdown_executor(void) /* {{{ */
}

zend_hash_destroy(&EG(included_files));
zend_hash_destroy(&EG(autoload_current_classnames));

zend_stack_destroy(&EG(user_error_handlers_error_reporting));
zend_stack_destroy(&EG(user_error_handlers));
zend_stack_destroy(&EG(user_exception_handlers));
zend_lazy_objects_destroy(&EG(lazy_objects_store));
zend_objects_store_destroy(&EG(objects_store));
if (EG(in_autoload)) {
zend_hash_destroy(EG(in_autoload));
FREE_HASHTABLE(EG(in_autoload));
}

if (EG(ht_iterators) != EG(ht_iterators_slots)) {
efree(EG(ht_iterators));
Expand Down Expand Up @@ -1245,12 +1242,7 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, zend_string *
return NULL;
}

if (EG(in_autoload) == NULL) {
ALLOC_HASHTABLE(EG(in_autoload));
zend_hash_init(EG(in_autoload), 8, NULL, NULL, 0);
}

if (zend_hash_add_empty_element(EG(in_autoload), lc_name) == NULL) {
if (zend_hash_add_empty_element(&EG(autoload_current_classnames), lc_name) == NULL) {
if (!key) {
zend_string_release_ex(lc_name, 0);
}
Expand All @@ -1272,7 +1264,7 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, zend_string *
EG(lineno_override) = previous_lineno;

zend_string_release_ex(autoload_name, 0);
zend_hash_del(EG(in_autoload), lc_name);
zend_hash_del(&EG(autoload_current_classnames), lc_name);

if (!key) {
zend_string_release_ex(lc_name, 0);
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ struct _zend_executor_globals {
zend_atomic_bool vm_interrupt;
zend_atomic_bool timed_out;

HashTable *in_autoload;
HashTable autoload_current_classnames;

zend_long hard_timeout;
void *stack_base;
Expand Down
Loading