@@ -417,7 +417,7 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS
417
417
418
418
compiler_globals -> auto_globals = (HashTable * ) malloc (sizeof (HashTable ));
419
419
zend_hash_init_ex (compiler_globals -> auto_globals , 8 , NULL , NULL , 1 , 0 );
420
- zend_hash_copy (compiler_globals -> auto_globals , global_auto_globals_table , NULL , NULL , sizeof (void * ) /* empty element */ );
420
+ zend_hash_copy (compiler_globals -> auto_globals , global_auto_globals_table , NULL , NULL , sizeof (zend_auto_global ) /* empty element */ );
421
421
}
422
422
423
423
@@ -573,7 +573,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
573
573
574
574
#ifdef ZTS
575
575
zend_hash_init_ex (GLOBAL_CONSTANTS_TABLE , 20 , NULL , ZEND_CONSTANT_DTOR , 1 , 0 );
576
- zend_hash_init_ex (GLOBAL_AUTO_GLOBALS_TABLE , 8 , NULL , NULL , 1 , 0 );
576
+ zend_hash_init_ex (GLOBAL_AUTO_GLOBALS_TABLE , 8 , NULL , ( dtor_func_t ) zend_auto_global_dtor , 1 , 0 );
577
577
ts_allocate_id (& compiler_globals_id , sizeof (zend_compiler_globals ), (ts_allocate_ctor ) compiler_globals_ctor , (ts_allocate_dtor ) compiler_globals_dtor );
578
578
ts_allocate_id (& executor_globals_id , sizeof (zend_executor_globals ), (ts_allocate_ctor ) executor_globals_ctor , (ts_allocate_dtor ) executor_globals_dtor );
579
579
ts_allocate_id (& language_scanner_globals_id , sizeof (zend_scanner_globals ), (ts_allocate_ctor ) scanner_globals_ctor , NULL );
@@ -590,7 +590,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
590
590
zend_hash_destroy (executor_globals -> zend_constants );
591
591
* executor_globals -> zend_constants = * GLOBAL_CONSTANTS_TABLE ;
592
592
#else
593
- zend_hash_init_ex (CG (auto_globals ), 8 , NULL , NULL , 1 , 0 );
593
+ zend_hash_init_ex (CG (auto_globals ), 8 , NULL , ( dtor_func_t ) zend_auto_global_dtor , 1 , 0 );
594
594
scanner_globals_ctor (& ini_scanner_globals TSRMLS_CC );
595
595
scanner_globals_ctor (& language_scanner_globals TSRMLS_CC );
596
596
zend_startup_constants ();
@@ -600,6 +600,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
600
600
#endif
601
601
register_standard_class (TSRMLS_C );
602
602
zend_register_standard_constants (TSRMLS_C );
603
+ zend_register_auto_global ("GLOBALS" , sizeof ("GLOBALS" )- 1 , NULL TSRMLS_CC );
603
604
604
605
#ifndef ZTS
605
606
zend_init_rsrc_plist (TSRMLS_C );
0 commit comments