diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2014-04-11 10:06:17 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2014-04-11 10:08:44 +0200 |
commit | f614fc68984b2d7fce3f275b8106955b5d910472 (patch) | |
tree | 10c98c57643c60af4d1ae6a56b7112fb274a65ed /ext/opcache | |
parent | d3f390a26888eefd012b4634137318797965ea86 (diff) | |
download | php-git-f614fc68984b2d7fce3f275b8106955b5d910472.tar.gz |
Fix bug #66015 by reverting "Removed operations on constant arrays."
Diffstat (limited to 'ext/opcache')
-rw-r--r-- | ext/opcache/ZendAccelerator.c | 6 | ||||
-rw-r--r-- | ext/opcache/zend_accelerator_util_funcs.c | 36 | ||||
-rw-r--r-- | ext/opcache/zend_persist.c | 2 | ||||
-rw-r--r-- | ext/opcache/zend_persist_calc.c | 2 |
4 files changed, 29 insertions, 17 deletions
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 55f856be5a..faa3641eb1 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2209,8 +2209,10 @@ static void accel_fast_zval_ptr_dtor(zval **zval_ptr) #else switch (Z_TYPE_P(zvalue) & ~IS_CONSTANT_INDEX) { #endif - case IS_ARRAY: - case IS_CONSTANT_ARRAY: { +#if ZEND_EXTENSION_API_NO <= PHP_5_5_API_NO + case IS_CONSTANT_ARRAY: +#endif + case IS_ARRAY: { TSRMLS_FETCH(); #if ZEND_EXTENSION_API_NO >= PHP_5_3_X_API_NO diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index 6204290efe..ae33e765ca 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -237,19 +237,21 @@ static zend_ast *zend_ast_clone(zend_ast *ast TSRMLS_DC) if ((Z_TYPE_P(ast->u.val) & IS_CONSTANT_TYPE_MASK) >= IS_ARRAY) { switch ((Z_TYPE_P(ast->u.val) & IS_CONSTANT_TYPE_MASK)) { case IS_STRING: - case IS_CONSTANT: + case IS_CONSTANT: Z_STRVAL_P(node->u.val) = (char *) interned_estrndup(Z_STRVAL_P(ast->u.val), Z_STRLEN_P(ast->u.val)); break; case IS_ARRAY: - case IS_CONSTANT_ARRAY: +#if ZEND_EXTENSION_API_NO <= PHP_5_5_API_NO + case IS_CONSTANT_ARRAY: +#endif if (ast->u.val->value.ht && ast->u.val->value.ht != &EG(symbol_table)) { ALLOC_HASHTABLE(node->u.val->value.ht); zend_hash_clone_zval(node->u.val->value.ht, ast->u.val->value.ht, 0); } break; - case IS_CONSTANT_AST: - Z_AST_P(node->u.val) = zend_ast_clone(Z_AST_P(ast->u.val) TSRMLS_CC); - break; + case IS_CONSTANT_AST: + Z_AST_P(node->u.val) = zend_ast_clone(Z_AST_P(ast->u.val) TSRMLS_CC); + break; } } } else { @@ -295,20 +297,22 @@ static inline zval* zend_clone_zval(zval *src, int bind TSRMLS_DC) switch ((Z_TYPE_P(ret) & ~IS_CONSTANT_INDEX)) { #endif case IS_STRING: - case IS_CONSTANT: + case IS_CONSTANT: Z_STRVAL_P(ret) = (char *) interned_estrndup(Z_STRVAL_P(ret), Z_STRLEN_P(ret)); break; case IS_ARRAY: - case IS_CONSTANT_ARRAY: +#if ZEND_EXTENSION_API_NO <= PHP_5_5_API_NO + case IS_CONSTANT_ARRAY: +#endif if (ret->value.ht && ret->value.ht != &EG(symbol_table)) { ALLOC_HASHTABLE(ret->value.ht); zend_hash_clone_zval(ret->value.ht, src->value.ht, 0); } break; #if ZEND_EXTENSION_API_NO > PHP_5_5_X_API_NO - case IS_CONSTANT_AST: - Z_AST_P(ret) = zend_ast_clone(Z_AST_P(ret) TSRMLS_CC); - break; + case IS_CONSTANT_AST: + Z_AST_P(ret) = zend_ast_clone(Z_AST_P(ret) TSRMLS_CC); + break; #endif } } @@ -417,20 +421,22 @@ static void zend_hash_clone_zval(HashTable *ht, HashTable *source, int bind) switch ((Z_TYPE_P((zval*)p->pDataPtr) & ~IS_CONSTANT_INDEX)) { #endif case IS_STRING: - case IS_CONSTANT: + case IS_CONSTANT: Z_STRVAL_P(ppz) = (char *) interned_estrndup(Z_STRVAL_P((zval*)p->pDataPtr), Z_STRLEN_P((zval*)p->pDataPtr)); break; case IS_ARRAY: - case IS_CONSTANT_ARRAY: +#if ZEND_EXTENSION_API_NO <= PHP_5_5_API_NO + case IS_CONSTANT_ARRAY: +#endif if (((zval*)p->pDataPtr)->value.ht && ((zval*)p->pDataPtr)->value.ht != &EG(symbol_table)) { ALLOC_HASHTABLE(ppz->value.ht); zend_hash_clone_zval(ppz->value.ht, ((zval*)p->pDataPtr)->value.ht, 0); } break; #if ZEND_EXTENSION_API_NO > PHP_5_5_X_API_NO - case IS_CONSTANT_AST: - Z_AST_P(ppz) = zend_ast_clone(Z_AST_P(ppz) TSRMLS_CC); - break; + case IS_CONSTANT_AST: + Z_AST_P(ppz) = zend_ast_clone(Z_AST_P(ppz) TSRMLS_CC); + break; #endif } } diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index 47f8f88312..17f8e8798f 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -174,7 +174,9 @@ static void zend_persist_zval(zval *z TSRMLS_DC) zend_accel_store_interned_string(z->value.str.val, z->value.str.len + 1); break; case IS_ARRAY: +#if ZEND_EXTENSION_API_NO <= PHP_5_5_API_NO case IS_CONSTANT_ARRAY: +#endif zend_accel_store(z->value.ht, sizeof(HashTable)); zend_hash_persist(z->value.ht, (zend_persist_func_t) zend_persist_zval_ptr, sizeof(zval**) TSRMLS_CC); break; diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c index c899ec8ac9..a01d834a4e 100644 --- a/ext/opcache/zend_persist_calc.c +++ b/ext/opcache/zend_persist_calc.c @@ -129,7 +129,9 @@ static uint zend_persist_zval_calc(zval *z TSRMLS_DC) ADD_INTERNED_STRING(Z_STRVAL_P(z), Z_STRLEN_P(z) + 1); break; case IS_ARRAY: +#if ZEND_EXTENSION_API_NO <= PHP_5_5_API_NO case IS_CONSTANT_ARRAY: +#endif ADD_DUP_SIZE(z->value.ht, sizeof(HashTable)); ADD_SIZE(zend_hash_persist_calc(z->value.ht, (int (*)(void* TSRMLS_DC)) zend_persist_zval_ptr_calc, sizeof(zval**) TSRMLS_CC)); break; |