@@ -1154,18 +1154,27 @@ static int zend_accel_get_auto_globals(TSRMLS_D)
1154
1154
{
1155
1155
int i , ag_size = (sizeof (jit_auto_globals_info ) / sizeof (jit_auto_globals_info [0 ]));
1156
1156
int n = 1 ;
1157
- zval * * res ;
1158
1157
int mask = 0 ;
1159
1158
1160
1159
for (i = 0 ; i < ag_size ; i ++ ) {
1161
- if (zend_hash_find (& EG (symbol_table ), jit_auto_globals_info [i ].name , jit_auto_globals_info [i ].len , ( void * ) & res ) == SUCCESS ) {
1160
+ if (zend_hash_exists (& EG (symbol_table ), jit_auto_globals_info [i ].name , jit_auto_globals_info [i ].len ) ) {
1162
1161
mask |= n ;
1163
1162
}
1164
1163
n += n ;
1165
1164
}
1166
1165
return mask ;
1167
1166
}
1168
1167
1168
+ #if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO
1169
+ static int zend_accel_get_auto_globals_no_jit (TSRMLS_D )
1170
+ {
1171
+ if (zend_hash_exists (& EG (symbol_table ), jit_auto_globals_info [3 ].name , jit_auto_globals_info [3 ].len )) {
1172
+ return 8 ;
1173
+ }
1174
+ return 0 ;
1175
+ }
1176
+ #endif
1177
+
1169
1178
static void zend_accel_set_auto_globals (int mask TSRMLS_DC )
1170
1179
{
1171
1180
int i , ag_size = (sizeof (jit_auto_globals_info ) / sizeof (jit_auto_globals_info [0 ]));
@@ -1318,11 +1327,15 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
1318
1327
will have to ping the used auto global variables before execution */
1319
1328
#if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO
1320
1329
if (PG (auto_globals_jit )) {
1330
+ new_persistent_script -> ping_auto_globals_mask = zend_accel_get_auto_globals (TSRMLS_C );
1331
+ } else {
1332
+ new_persistent_script -> ping_auto_globals_mask = zend_accel_get_auto_globals_no_jit (TSRMLS_C );
1333
+ }
1321
1334
#else
1322
1335
if ((PG (auto_globals_jit ) && !PG (register_globals ) && !PG (register_long_arrays ))) {
1323
- #endif
1324
1336
new_persistent_script -> ping_auto_globals_mask = zend_accel_get_auto_globals (TSRMLS_C );
1325
- }
1337
+ }
1338
+ #endif
1326
1339
1327
1340
if (ZCG (accel_directives ).validate_timestamps ) {
1328
1341
/* Obtain the file timestamps, *before* actually compiling them,
0 commit comments