From 9e753531842f524a1a147ca0244c041e59ecd117 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 3 Sep 2014 15:16:32 +0200 Subject: Use zval_ptr_dtor_nogc to destroy literals Also move the definition of zval_ptr_dtor_nogc to zend_variables.h (from zend_execute.h/.c) as it's used in a few places. --- Zend/zend_ast.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'Zend/zend_ast.c') diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 2f7c9fd87d..8c9607fcff 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -382,16 +382,11 @@ static void zend_ast_destroy_ex(zend_ast *ast, zend_bool free) { 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. */ - zval *zv = zend_ast_get_zval(ast); - if (Z_REFCOUNTED_P(zv) && !Z_DELREF_P(zv)) { - _zval_dtor_func_for_ptr(Z_COUNTED_P(zv) ZEND_FILE_LINE_CC); - } + zval_ptr_dtor_nogc(zend_ast_get_zval(ast)); break; - } case ZEND_AST_FUNC_DECL: case ZEND_AST_CLOSURE: case ZEND_AST_METHOD: -- cgit v1.2.1