]> granicus.if.org Git - php/commitdiff
Removed workaraouns for inconsistent zvals (REFCOUNTED+INTERNED). They should be...
authorDmitry Stogov <dmitry@zend.com>
Fri, 3 Nov 2017 18:02:55 +0000 (21:02 +0300)
committerDmitry Stogov <dmitry@zend.com>
Fri, 3 Nov 2017 18:02:55 +0000 (21:02 +0300)
Zend/zend_ast.c
Zend/zend_variables.c

index f4e7c09a83d69409ad9b9e853ccf0db8cf014966..68db0e023f9f7d583306722ad9fa4746cff3ee65 100644 (file)
@@ -557,24 +557,13 @@ ZEND_API zend_ast_ref *zend_ast_copy(zend_ast *ast)
 }
 
 ZEND_API void zend_ast_destroy(zend_ast *ast) {
-       zval *zv;
-
        if (!ast) {
                return;
        }
 
        switch (ast->kind) {
                case ZEND_AST_ZVAL:
-                       /* Destroy value without using GC: When opcache moves arrays into SHM it will
-                        * free the zend_array structure, so references to it from outside the op array
-                        * become invalid. GC would cause such a reference in the root buffer. */
-                       zv = zend_ast_get_zval(ast);
-                       if (Z_TYPE_P(zv) == IS_STRING) {
-                               /* Compiler may keep REFCOUNTED zvals with INTERNED strings */
-                               zend_string_release(Z_STR_P(zv));
-                       } else {
-                               zval_ptr_dtor_nogc(zv);
-                       }
+                       zval_ptr_dtor_nogc(zend_ast_get_zval(ast));
                        break;
                case ZEND_AST_CONSTANT:
                        zend_string_release(zend_ast_get_constant_name(ast));
index 7ff0916e7ce7574082361c1de9fff44a96fd5caa..1d3d2a66a747dc5154f8647c071d9f3e8af8fcc3 100644 (file)
@@ -34,13 +34,9 @@ ZEND_API void ZEND_FASTCALL _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC
                case IS_STRING: {
                                zend_string *str = (zend_string*)p;
                                CHECK_ZVAL_STRING_REL(str);
-#if ZEND_RC_DEBUG
                                ZEND_ASSERT(!ZSTR_IS_INTERNED(str));
                                ZEND_ASSERT(GC_REFCOUNT(str) == 0);
                                pefree(str, GC_FLAGS(str) & IS_STR_PERSISTENT);
-#else
-                               zend_string_free(str);
-#endif
                                break;
                        }
                case IS_ARRAY: {