]> granicus.if.org Git - php/commitdiff
Keep constnat flags
authorDmitry Stogov <dmitry@zend.com>
Tue, 1 Apr 2014 08:20:16 +0000 (12:20 +0400)
committerDmitry Stogov <dmitry@zend.com>
Tue, 1 Apr 2014 08:20:16 +0000 (12:20 +0400)
ext/opcache/zend_persist.c
ext/opcache/zend_persist_calc.c

index 5562f8c55de537bc9d044680b4256ea56bb656fe..d638acdb151512190691a23aca563b656c7119ee 100644 (file)
@@ -111,6 +111,7 @@ static zend_ast *zend_persist_ast(zend_ast *ast TSRMLS_DC)
 
 static void zend_persist_zval(zval *z TSRMLS_DC)
 {
+       zend_uchar flags;
        void *new_ptr;
 
 #if ZEND_EXTENSION_API_NO >= PHP_5_3_X_API_NO
@@ -120,7 +121,9 @@ static void zend_persist_zval(zval *z TSRMLS_DC)
 #endif
                case IS_STRING:
                case IS_CONSTANT:
+                       flags = Z_STR_P(z)->gc.u.v.flags & ~ (IS_STR_PERSISTENT | IS_STR_INTERNED | IS_STR_PERMANENT);
                        zend_accel_store_interned_string(Z_STR_P(z));
+                       Z_STR_P(z)->gc.u.v.flags |= flags;
                        break;
                case IS_ARRAY:
                case IS_CONSTANT_ARRAY:
index 5bd358df5c28dfa3de748c9c11168164439edb75..48038dcf48eabdaa4f13b20db2ebd40ef49915ff 100644 (file)
@@ -73,7 +73,9 @@ static uint zend_hash_persist_calc(HashTable *ht, uint (*pPersistElement)(zval *
 
                /* persist bucket and key */
                if (p->key) {
+                       zend_uchar flags = p->key->gc.u.v.flags & ~ (IS_STR_PERSISTENT | IS_STR_INTERNED | IS_STR_PERMANENT);
                        ADD_INTERNED_STRING(p->key, 1);
+                       p->key->gc.u.v.flags |= flags;
                }
 
                ADD_SIZE(pPersistElement(&p->val TSRMLS_CC));
@@ -105,6 +107,7 @@ static uint zend_persist_ast_calc(zend_ast *ast TSRMLS_DC)
 
 static uint zend_persist_zval_calc(zval *z TSRMLS_DC)
 {
+       zend_uchar flags;
        uint size;
        START_SIZE();
 
@@ -115,7 +118,9 @@ static uint zend_persist_zval_calc(zval *z TSRMLS_DC)
 #endif
                case IS_STRING:
                case IS_CONSTANT:
+                       flags = Z_STR_P(z)->gc.u.v.flags & ~ (IS_STR_PERSISTENT | IS_STR_INTERNED | IS_STR_PERMANENT);
                        ADD_INTERNED_STRING(Z_STR_P(z), 0);
+                       Z_STR_P(z)->gc.u.v.flags |= flags;
                        break;
                case IS_ARRAY:
                case IS_CONSTANT_ARRAY: