summaryrefslogtreecommitdiff
path: root/ZendAccelerator.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2013-03-15 10:45:49 +0400
committerDmitry Stogov <dmitry@zend.com>2013-03-15 10:45:49 +0400
commit0ab356c8e59018fbedd0fd6ddfd6a82f4558c9a9 (patch)
tree3dc6af63b1a3524d43a5930056b1c1bf30482616 /ZendAccelerator.c
parent61ac64b372bdd09144a7c276bb7094478ec3132f (diff)
downloadphp-git-0ab356c8e59018fbedd0fd6ddfd6a82f4558c9a9.tar.gz
Autogolobal $GLOBALS has to be pinged even if auto_globals_jit=0
Diffstat (limited to 'ZendAccelerator.c')
-rw-r--r--ZendAccelerator.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/ZendAccelerator.c b/ZendAccelerator.c
index e6029cf454..bb571a4805 100644
--- a/ZendAccelerator.c
+++ b/ZendAccelerator.c
@@ -1154,11 +1154,10 @@ static int zend_accel_get_auto_globals(TSRMLS_D)
{
int i, ag_size = (sizeof(jit_auto_globals_info) / sizeof(jit_auto_globals_info[0]));
int n = 1;
- zval **res;
int mask = 0;
for (i = 0; i < ag_size ; i++) {
- if (zend_hash_find(&EG(symbol_table), jit_auto_globals_info[i].name, jit_auto_globals_info[i].len, (void *)&res) == SUCCESS) {
+ if (zend_hash_exists(&EG(symbol_table), jit_auto_globals_info[i].name, jit_auto_globals_info[i].len)) {
mask |= n;
}
n += n;
@@ -1166,6 +1165,16 @@ static int zend_accel_get_auto_globals(TSRMLS_D)
return mask;
}
+#if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO
+static int zend_accel_get_auto_globals_no_jit(TSRMLS_D)
+{
+ if (zend_hash_exists(&EG(symbol_table), jit_auto_globals_info[3].name, jit_auto_globals_info[3].len)) {
+ return 8;
+ }
+ return 0;
+}
+#endif
+
static void zend_accel_set_auto_globals(int mask TSRMLS_DC)
{
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
will have to ping the used auto global variables before execution */
#if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO
if (PG(auto_globals_jit)) {
+ new_persistent_script->ping_auto_globals_mask = zend_accel_get_auto_globals(TSRMLS_C);
+ } else {
+ new_persistent_script->ping_auto_globals_mask = zend_accel_get_auto_globals_no_jit(TSRMLS_C);
+ }
#else
if ((PG(auto_globals_jit) && !PG(register_globals) && !PG(register_long_arrays))) {
-#endif
new_persistent_script->ping_auto_globals_mask = zend_accel_get_auto_globals(TSRMLS_C);
- }
+ }
+#endif
if (ZCG(accel_directives).validate_timestamps) {
/* Obtain the file timestamps, *before* actually compiling them,