]> granicus.if.org Git - php/commitdiff
Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized destructors.
authorDmitry Stogov <dmitry@zend.com>
Wed, 4 Jul 2018 16:22:24 +0000 (19:22 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 4 Jul 2018 16:22:24 +0000 (19:22 +0300)
zval_dtor() doesn't make a lot of sense in PHP-7.* and it's used incorrectly in some places.
Its occurances should be replaced by zval_ptr_dtor() or zval_ptr_dtor_nogc(), or even more specialized destructors.

52 files changed:
Zend/zend_API.c
Zend/zend_ast.c
Zend/zend_compile.c
Zend/zend_constants.c
Zend/zend_execute_API.c
Zend/zend_language_scanner.c
Zend/zend_language_scanner.l
ext/date/php_date.c
ext/dom/xpath.c
ext/gmp/gmp.c
ext/iconv/iconv.c
ext/imap/php_imap.c
ext/interbase/php_ibase_udf.c
ext/intl/collator/collator_convert.c
ext/intl/converter/converter.c
ext/intl/locale/locale_methods.c
ext/intl/timezone/timezone_class.cpp
ext/intl/transliterator/transliterator_class.c
ext/intl/transliterator/transliterator_methods.c
ext/ldap/ldap.c
ext/mbstring/php_mbregex.c
ext/mysqli/mysqli.c
ext/mysqlnd/mysqlnd_result.c
ext/openssl/openssl.c
ext/pdo/pdo_stmt.c
ext/pgsql/pgsql.c
ext/phar/phar_object.c
ext/posix/posix.c
ext/reflection/php_reflection.c
ext/session/session.c
ext/simplexml/simplexml.c
ext/sockets/conversions.c
ext/standard/basic_functions.c
ext/standard/dir.c
ext/standard/dns.c
ext/standard/dns_win32.c
ext/standard/file.c
ext/standard/pack.c
ext/standard/var.c
ext/tokenizer/tokenizer.c
ext/wddx/wddx.c
ext/xmlreader/php_xmlreader.c
ext/zip/php_zip.c
main/php_variables.c
main/snprintf.c
main/spprintf.c
sapi/litespeed/lsapi_main.c
sapi/phpdbg/phpdbg_bp.c
sapi/phpdbg/phpdbg_out.c
sapi/phpdbg/phpdbg_prompt.c
sapi/phpdbg/phpdbg_wait.c
sapi/phpdbg/phpdbg_webdata_transfer.c

index 20b2d65b8d775117759a84fee91d36cc51f7a182..1699f1b50a94bb60c1b9213adef9278a0102f395 100644 (file)
@@ -3465,7 +3465,7 @@ ZEND_API zend_bool zend_make_callable(zval *callable, zend_string **callable_nam
 
        if (zend_is_callable_ex(callable, NULL, IS_CALLABLE_STRICT, callable_name, &fcc, NULL)) {
                if (Z_TYPE_P(callable) == IS_STRING && fcc.calling_scope) {
-                       zval_dtor(callable);
+                       zval_ptr_dtor_str(callable);
                        array_init(callable);
                        add_next_index_str(callable, zend_string_copy(fcc.calling_scope->name));
                        add_next_index_str(callable, zend_string_copy(fcc.function_handler->common.function_name));
index 838cc361ffb70103b16bc49e3f2faf4f05dfefd2..ff1fd1b7447e4bfbd94cc7b7fd0c2f5a037e8449 100644 (file)
@@ -405,12 +405,12 @@ static int zend_ast_add_array_element(zval *result, zval *offset, zval *expr)
                        if (!zend_hash_next_index_insert(Z_ARRVAL_P(result), expr)) {
                                zend_error(E_WARNING,
                                        "Cannot add element to the array as the next element is already occupied");
-                               zval_ptr_dtor(expr);
+                               zval_ptr_dtor_nogc(expr);
                        }
                        break;
                case IS_STRING:
                        zend_symtable_update(Z_ARRVAL_P(result), Z_STR_P(offset), expr);
-                       zval_dtor(offset);
+                       zval_ptr_dtor_str(offset);
                        break;
                case IS_NULL:
                        zend_symtable_update(Z_ARRVAL_P(result), ZSTR_EMPTY_ALLOC(), expr);
@@ -448,13 +448,13 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
                        if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
                                ret = FAILURE;
                        } else if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) {
-                               zval_dtor(&op1);
+                               zval_ptr_dtor_nogc(&op1);
                                ret = FAILURE;
                        } else {
                                binary_op_type op = get_binary_op(ast->attr);
                                ret = op(result, &op1, &op2);
-                               zval_dtor(&op1);
-                               zval_dtor(&op2);
+                               zval_ptr_dtor_nogc(&op1);
+                               zval_ptr_dtor_nogc(&op2);
                        }
                        break;
                case ZEND_AST_GREATER:
@@ -462,15 +462,15 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
                        if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
                                ret = FAILURE;
                        } else if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) {
-                               zval_dtor(&op1);
+                               zval_ptr_dtor_nogc(&op1);
                                ret = FAILURE;
                        } else {
                                /* op1 > op2 is the same as op2 < op1 */
                                binary_op_type op = ast->kind == ZEND_AST_GREATER
                                        ? is_smaller_function : is_smaller_or_equal_function;
                                ret = op(result, &op2, &op1);
-                               zval_dtor(&op1);
-                               zval_dtor(&op2);
+                               zval_ptr_dtor_nogc(&op1);
+                               zval_ptr_dtor_nogc(&op2);
                        }
                        break;
                case ZEND_AST_UNARY_OP:
@@ -479,7 +479,7 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
                        } else {
                                unary_op_type op = get_unary_op(ast->attr);
                                ret = op(result, &op1);
-                               zval_dtor(&op1);
+                               zval_ptr_dtor_nogc(&op1);
                        }
                        break;
                case ZEND_AST_ZVAL:
@@ -517,16 +517,16 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
                        }
                        if (zend_is_true(&op1)) {
                                if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) {
-                                       zval_dtor(&op1);
+                                       zval_ptr_dtor_nogc(&op1);
                                        ret = FAILURE;
                                        break;
                                }
                                ZVAL_BOOL(result, zend_is_true(&op2));
-                               zval_dtor(&op2);
+                               zval_ptr_dtor_nogc(&op2);
                        } else {
                                ZVAL_FALSE(result);
                        }
-                       zval_dtor(&op1);
+                       zval_ptr_dtor_nogc(&op1);
                        break;
                case ZEND_AST_OR:
                        if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
@@ -537,14 +537,14 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
                                ZVAL_TRUE(result);
                        } else {
                                if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) {
-                                       zval_dtor(&op1);
+                                       zval_ptr_dtor_nogc(&op1);
                                        ret = FAILURE;
                                        break;
                                }
                                ZVAL_BOOL(result, zend_is_true(&op2));
-                               zval_dtor(&op2);
+                               zval_ptr_dtor_nogc(&op2);
                        }
-                       zval_dtor(&op1);
+                       zval_ptr_dtor_nogc(&op1);
                        break;
                case ZEND_AST_CONDITIONAL:
                        if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
@@ -556,19 +556,19 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
                                        *result = op1;
                                } else {
                                        if (UNEXPECTED(zend_ast_evaluate(result, ast->child[1], scope) != SUCCESS)) {
-                                               zval_dtor(&op1);
+                                               zval_ptr_dtor_nogc(&op1);
                                                ret = FAILURE;
                                                break;
                                        }
-                                       zval_dtor(&op1);
+                                       zval_ptr_dtor_nogc(&op1);
                                }
                        } else {
                                if (UNEXPECTED(zend_ast_evaluate(result, ast->child[2], scope) != SUCCESS)) {
-                                       zval_dtor(&op1);
+                                       zval_ptr_dtor_nogc(&op1);
                                        ret = FAILURE;
                                        break;
                                }
-                               zval_dtor(&op1);
+                               zval_ptr_dtor_nogc(&op1);
                        }
                        break;
                case ZEND_AST_COALESCE:
@@ -580,11 +580,11 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
                                *result = op1;
                        } else {
                                if (UNEXPECTED(zend_ast_evaluate(result, ast->child[1], scope) != SUCCESS)) {
-                                       zval_dtor(&op1);
+                                       zval_ptr_dtor_nogc(&op1);
                                        ret = FAILURE;
                                        break;
                                }
-                               zval_dtor(&op1);
+                               zval_ptr_dtor_nogc(&op1);
                        }
                        break;
                case ZEND_AST_UNARY_PLUS:
@@ -593,7 +593,7 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
                        } else {
                                ZVAL_LONG(&op1, 0);
                                ret = add_function(result, &op1, &op2);
-                               zval_dtor(&op2);
+                               zval_ptr_dtor_nogc(&op2);
                        }
                        break;
                case ZEND_AST_UNARY_MINUS:
@@ -602,7 +602,7 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
                        } else {
                                ZVAL_LONG(&op1, 0);
                                ret = sub_function(result, &op1, &op2);
-                               zval_dtor(&op2);
+                               zval_ptr_dtor_nogc(&op2);
                        }
                        break;
                case ZEND_AST_ARRAY:
@@ -619,21 +619,21 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
                                        zend_ast *elem = list->child[i];
                                        if (elem->child[1]) {
                                                if (UNEXPECTED(zend_ast_evaluate(&op1, elem->child[1], scope) != SUCCESS)) {
-                                                       zval_dtor(result);
+                                                       zval_ptr_dtor_nogc(result);
                                                        return FAILURE;
                                                }
                                        } else {
                                                ZVAL_UNDEF(&op1);
                                        }
                                        if (UNEXPECTED(zend_ast_evaluate(&op2, elem->child[0], scope) != SUCCESS)) {
-                                               zval_dtor(&op1);
-                                               zval_dtor(result);
+                                               zval_ptr_dtor_nogc(&op1);
+                                               zval_ptr_dtor_nogc(result);
                                                return FAILURE;
                                        }
                                        if (UNEXPECTED(zend_ast_add_array_element(result, &op1, &op2) != SUCCESS)) {
-                                               zval_dtor(&op1);
-                                               zval_dtor(&op2);
-                                               zval_dtor(result);
+                                               zval_ptr_dtor_nogc(&op1);
+                                               zval_ptr_dtor_nogc(&op2);
+                                               zval_ptr_dtor_nogc(result);
                                                return FAILURE;
                                        }
                                }
@@ -647,13 +647,13 @@ ZEND_API int ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast, zend_c
                        if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
                                ret = FAILURE;
                        } else if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) {
-                               zval_dtor(&op1);
+                               zval_ptr_dtor_nogc(&op1);
                                ret = FAILURE;
                        } else {
                                zend_fetch_dimension_const(result, &op1, &op2, (ast->attr == ZEND_DIM_IS) ? BP_VAR_IS : BP_VAR_R);
 
-                               zval_dtor(&op1);
-                               zval_dtor(&op2);
+                               zval_ptr_dtor_nogc(&op1);
+                               zval_ptr_dtor_nogc(&op2);
                        }
                        break;
                default:
index 602d639f252b798a56e99e5865e85c4822d8f4e8..c050855ae8d422381c6db58d9c4d70e1913e418c 100644 (file)
@@ -460,7 +460,7 @@ static int lookup_cv(zend_op_array *op_array, zend_string *name) /* {{{ */{
 
 void zend_del_literal(zend_op_array *op_array, int n) /* {{{ */
 {
-       zval_dtor(CT_CONSTANT_EX(op_array, n));
+       zval_ptr_dtor_nogc(CT_CONSTANT_EX(op_array, n));
        if (n + 1 == op_array->last_literal) {
                op_array->last_literal--;
        } else {
@@ -3449,7 +3449,7 @@ int zend_compile_func_strlen(znode *result, zend_ast_list *args) /* {{{ */
        if (arg_node.op_type == IS_CONST && Z_TYPE(arg_node.u.constant) == IS_STRING) {
                result->op_type = IS_CONST;
                ZVAL_LONG(&result->u.constant, Z_STRLEN(arg_node.u.constant));
-               zval_dtor(&arg_node.u.constant);
+               zval_ptr_dtor_str(&arg_node.u.constant);
        } else {
                zend_emit_op_tmp(result, ZEND_STRLEN, &arg_node, NULL);
        }
@@ -4608,7 +4608,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline) /* {{{ */
                zend_error_noreturn(E_COMPILE_ERROR, "'goto' to undefined label '%s'", Z_STRVAL_P(label));
        }
 
-       zval_dtor(label);
+       zval_ptr_dtor_str(label);
        ZVAL_NULL(label);
 
        current = opline->extended_value;
@@ -5101,7 +5101,7 @@ void zend_compile_switch(zend_ast *ast) /* {{{ */
                opline->opcode = ZEND_FREE;
                SET_NODE(opline->op1, &expr_node);
        } else if (expr_node.op_type == IS_CONST) {
-               zval_dtor(&expr_node.u.constant);
+               zval_ptr_dtor_nogc(&expr_node.u.constant);
        }
 
        efree(jmpnz_opnums);
@@ -5377,7 +5377,7 @@ void zend_compile_declare(zend_ast *ast) /* {{{ */
                        zval value_zv;
                        zend_const_expr_to_zval(&value_zv, value_ast);
                        FC(declarables).ticks = zval_get_long(&value_zv);
-                       zval_dtor(&value_zv);
+                       zval_ptr_dtor_nogc(&value_zv);
                } else if (zend_string_equals_literal_ci(name, "encoding")) {
 
                        if (FAILURE == zend_declare_is_first_statement(ast)) {
index daf430d1f960f4a39dae15974be2f1280f9e395e..fe1d9e235b459c0475354d77da4e8a7705f71554 100644 (file)
@@ -40,7 +40,7 @@ void free_zend_constant(zval *zv)
        zend_constant *c = Z_PTR_P(zv);
 
        if (!(c->flags & CONST_PERSISTENT)) {
-               zval_ptr_dtor(&c->value);
+               zval_ptr_dtor_nogc(&c->value);
                if (c->name) {
                        zend_string_release_ex(c->name, 0);
                }
@@ -514,7 +514,7 @@ ZEND_API int zend_register_constant(zend_constant *c)
                zend_error(E_NOTICE,"Constant %s already defined", ZSTR_VAL(name));
                zend_string_release(c->name);
                if (!(c->flags & CONST_PERSISTENT)) {
-                       zval_dtor(&c->value);
+                       zval_ptr_dtor_nogc(&c->value);
                }
                ret = FAILURE;
        }
index eba3b625ab044f314ac35aeb8d0c979a134d750b..d08b77a520084e69e0ee9addbf11cffae29f6710 100644 (file)
@@ -943,7 +943,7 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
        zend_exception_restore();
 
        zval_ptr_dtor(&args[0]);
-       zval_dtor(&fcall_info.function_name);
+       zval_ptr_dtor_str(&fcall_info.function_name);
 
        zend_hash_del(EG(in_autoload), lc_name);
 
@@ -1055,7 +1055,7 @@ ZEND_API int zend_eval_stringl(char *str, size_t str_len, zval *retval_ptr, char
        } else {
                retval = FAILURE;
        }
-       zval_dtor(&pv);
+       zval_ptr_dtor_str(&pv);
        return retval;
 }
 /* }}} */
index db713464deda538c4ce240e129d2b721ba148646..8621f952ae205cf9ca44bb5ef189ccdd3077af4c 100644 (file)
@@ -1195,7 +1195,7 @@ static zend_bool strip_multiline_string_indentation(
        return 1;
 
 error:
-       zval_dtor(zendlval);
+       zval_ptr_dtor_str(zendlval);
        ZVAL_UNDEF(zendlval);
 
        return 0;
@@ -4743,7 +4743,7 @@ yy397:
 
                        ZVAL_UNDEF(&zv);
                        retval = lex_scan(&zv, NULL);
-                       zval_dtor(&zv);
+                       zval_ptr_dtor_nogc(&zv);
 
                        if (EG(exception)) {
                                zend_clear_exception();
index 5005634dce1c2abb444ee75ba358cf8d181c2ca7..c75bf3c40c1eac32b4393144025599a83efb58aa 100644 (file)
@@ -1192,7 +1192,7 @@ static zend_bool strip_multiline_string_indentation(
        return 1;
 
 error:
-       zval_dtor(zendlval);
+       zval_ptr_dtor_str(zendlval);
        ZVAL_UNDEF(zendlval);
 
        return 0;
@@ -2355,7 +2355,7 @@ skip_escape_conversion:
 
                        ZVAL_UNDEF(&zv);
                        retval = lex_scan(&zv, NULL);
-                       zval_dtor(&zv);
+                       zval_ptr_dtor_nogc(&zv);
 
                        if (EG(exception)) {
                                zend_clear_exception();
index 174216ea501cebfc3bc19b368f767ed931fddabe..6f7f138f8e2519d43127d760369f4fbfa1637b11 100644 (file)
@@ -2064,7 +2064,7 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
        if (!obj->initialized) {
                retval = zend_std_has_property(object, member, type, cache_slot);
                if (member == &tmp_member) {
-                       zval_dtor(member);
+                       zval_ptr_dtor_str(&tmp_member);
                }
                return retval;
        }
@@ -2084,7 +2084,7 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
        }
 
        if (member == &tmp_member) {
-               zval_dtor(member);
+               zval_ptr_dtor_str(&tmp_member);
        }
 
        return retval;
@@ -4159,7 +4159,7 @@ zval *date_interval_read_property(zval *object, zval *member, int type, void **c
        if (!obj->initialized) {
                retval = zend_std_read_property(object, member, type, cache_slot, rv);
                if (member == &tmp_member) {
-                       zval_dtor(member);
+                       zval_ptr_dtor_str(&tmp_member);
                }
                return retval;
        }
@@ -4186,7 +4186,7 @@ zval *date_interval_read_property(zval *object, zval *member, int type, void **c
                retval = zend_std_read_property(object, member, type, cache_slot, rv);
 
                if (member == &tmp_member) {
-                       zval_dtor(member);
+                       zval_ptr_dtor_str(&tmp_member);
                }
 
                return retval;
@@ -4203,7 +4203,7 @@ zval *date_interval_read_property(zval *object, zval *member, int type, void **c
        }
 
        if (member == &tmp_member) {
-               zval_dtor(member);
+               zval_ptr_dtor_str(&tmp_member);
        }
 
        return retval;
@@ -4227,7 +4227,7 @@ void date_interval_write_property(zval *object, zval *member, zval *value, void
        if (!obj->initialized) {
                zend_std_write_property(object, member, value, cache_slot);
                if (member == &tmp_member) {
-                       zval_dtor(member);
+                       zval_ptr_dtor_str(&tmp_member);
                }
                return;
        }
@@ -4255,7 +4255,7 @@ void date_interval_write_property(zval *object, zval *member, zval *value, void
        } while(0);
 
        if (member == &tmp_member) {
-               zval_dtor(member);
+               zval_ptr_dtor_str(&tmp_member);
        }
 }
 /* }}} */
@@ -4287,7 +4287,7 @@ static zval *date_interval_get_property_ptr_ptr(zval *object, zval *member, int
        }
 
        if (member == &tmp_member) {
-               zval_dtor(member);
+               zval_ptr_dtor_str(&tmp_member);
        }
 
        return ret;
index a63abaf6cde37ad4d1fce17291de3e2ccebc4486..d6c410b17d5ecb865e9ce72704e908935970d8b7 100644 (file)
@@ -227,7 +227,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
                }
        }
        zend_string_release_ex(callable, 0);
-       zval_dtor(&fci.function_name);
+       zval_ptr_dtor_str(&fci.function_name);
        if (fci.param_count > 0) {
                for (i = 0; i < nargs - 1; i++) {
                        zval_ptr_dtor(&fci.params[i]);
index b3cc77e750447987d40405559c889e1b527cc5e7..93c69d33479d513a1f1db2c4694c238afdb6a216 100644 (file)
@@ -577,7 +577,7 @@ static int gmp_serialize(zval *object, unsigned char **buffer, size_t *buf_len,
 
        gmp_strval(&zv, gmpnum, 10);
        php_var_serialize(&buf, &zv, &serialize_data);
-       zval_dtor(&zv);
+       zval_ptr_dtor_str(&zv);
 
        ZVAL_ARR(&zv, zend_std_get_properties(object));
        php_var_serialize(&buf, &zv, &serialize_data);
index 7070454433b34253543d4b7631283edae1c9fc51..bdd4a26da5b591d42b38c4dda95333adb2e29ed5 100644 (file)
@@ -2435,7 +2435,7 @@ PHP_FUNCTION(iconv_mime_decode_headers)
 
        if (err != PHP_ICONV_ERR_SUCCESS) {
                _php_iconv_show_error(err, charset, "???");
-               zval_dtor(return_value);
+               zend_array_destroy(Z_ARR_P(return_value));
                RETVAL_FALSE;
        }
 }
index d5f07a3e22eef11aa4f34d7a1e5278d489225cc1..86b0011f094776d025bf9ca363b5f2c8efb94ab1 100644 (file)
@@ -1436,7 +1436,7 @@ PHP_FUNCTION(imap_get_quota)
        mail_parameters(NIL, SET_QUOTA, (void *) mail_getquota);
        if (!imap_getquota(imap_le_struct->imap_stream, ZSTR_VAL(qroot))) {
                php_error_docref(NULL, E_WARNING, "c-client imap_getquota failed");
-               zval_dtor(return_value);
+               zend_array_destroy(Z_ARR_P(return_value));
                RETURN_FALSE;
        }
 }
@@ -1465,7 +1465,7 @@ PHP_FUNCTION(imap_get_quotaroot)
        mail_parameters(NIL, SET_QUOTA, (void *) mail_getquota);
        if (!imap_getquotaroot(imap_le_struct->imap_stream, ZSTR_VAL(mbox))) {
                php_error_docref(NULL, E_WARNING, "c-client imap_getquotaroot failed");
-               zval_dtor(return_value);
+               zend_array_destroy(Z_ARR_P(return_value));
                RETURN_FALSE;
        }
 }
@@ -1542,7 +1542,7 @@ PHP_FUNCTION(imap_getacl)
        mail_parameters(NIL, SET_ACL, (void *) mail_getacl);
        if (!imap_getacl(imap_le_struct->imap_stream, ZSTR_VAL(mailbox))) {
                php_error(E_WARNING, "c-client imap_getacl failed");
-               zval_dtor(return_value);
+               zend_array_destroy(Z_ARR_P(return_value));
                RETURN_FALSE;
        }
 
@@ -4290,7 +4290,7 @@ PHP_FUNCTION(imap_mime_header_decode)
                                        }
                                        if (decode == NULL) {
                                                efree(charset);
-                                               zval_dtor(return_value);
+                                               zend_array_destroy(Z_ARR_P(return_value));
                                                RETURN_FALSE;
                                        }
                                        object_init(&myobject);
index f7dfe2db15c1a3e2267fba8cc9c2d7af521482aa..b8bb6034bb2303e9026a37053e69b101f8e8b31a 100644 (file)
@@ -302,7 +302,7 @@ static void call_php(char *name, PARAMDSC *r, int argc, PARAMDSC **argv)
                        }
                }
 
-               zval_dtor(&callback);
+               zval_ptr_dtor_str(&callback);
 
                /* return whatever type we got back from the callback: let DB handle conversion */
                switch (Z_TYPE(return_value)) {
index 63132b1eb02b2728a607adab5ef65ddaad5f018a..6ec24afe10b695bc92bf283ab49f4657da4be8dc 100644 (file)
@@ -275,7 +275,7 @@ zval* collator_convert_object_to_string( zval* obj, zval *rv )
                php_error( E_WARNING, "Error casting object to string in collator_convert_object_to_string()" );
 
        /* Cleanup zstr to hold utf16 string. */
-       zval_dtor( zstr );
+       zval_ptr_dtor_str( zstr );
 
        /* Set string. */
        ZVAL_STRINGL( zstr, (char*)ustr, UBYTES(ustr_len));
@@ -392,7 +392,7 @@ zval* collator_make_printable_zval( zval* arg, zval *rv)
                if( use_copy )
                {
                        str = collator_convert_zstr_utf8_to_utf16( &arg_copy, rv );
-                       zval_dtor( &arg_copy );
+                       zval_ptr_dtor_str( &arg_copy );
                }
                else
                {
index 7d012b86bb6c610d592b1505767d451f61708991..079f69e9930013ec1eca5a1b3c829f3389898354 100644 (file)
@@ -931,7 +931,7 @@ static PHP_METHOD(UConverter, getAliases) {
                alias = ucnv_getAlias(name, i, &error);
                if (U_FAILURE(error)) {
                        THROW_UFAILURE(NULL, "ucnv_getAlias", error);
-                       zval_dtor(return_value);
+                       zend_array_destroy(Z_ARR_P(return_value));
                        RETURN_NULL();
                }
                add_next_index_string(return_value, alias);
@@ -959,7 +959,7 @@ static PHP_METHOD(UConverter, getStandards) {
                const char *name = ucnv_getStandard(i, &error);
                if (U_FAILURE(error)) {
                        THROW_UFAILURE(NULL, "ucnv_getStandard", error);
-                       zval_dtor(return_value);
+                       zend_array_destroy(Z_ARR_P(return_value));
                        RETURN_NULL();
                }
                add_next_index_string(return_value, name);
index 437b9e404dee125711afeffc38e1b8839b5243e1..35bec40a7a2dbcda86f4d1a0f52cfa7397005972 100644 (file)
@@ -744,7 +744,7 @@ PHP_FUNCTION( locale_get_keywords )
                                if( kw_value_str){
                                        zend_string_efree( kw_value_str );
                                }
-                               zval_dtor(return_value);
+                               zend_array_destroy(Z_ARR_P(return_value));
                        RETURN_FALSE;
                        }
 
index 929797a96e7cab436684cad95af6b80dd985ccd5..1f20ea9b52c26814375f0e47caa61f62b12a8727 100644 (file)
@@ -154,7 +154,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
                                intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
                                efree(message);
                        }
-                       zval_dtor(&local_zv_tz);
+                       zval_ptr_dtor_str(&local_zv_tz);
                        return NULL;
                }
                timeZone = to->utimezone->clone();
@@ -164,7 +164,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
                                intl_errors_set(outside_error, U_MEMORY_ALLOCATION_ERROR, message, 1);
                                efree(message);
                        }
-                       zval_dtor(&local_zv_tz);
+                       zval_ptr_dtor_str(&local_zv_tz);
                        return NULL;
                }
        } else if (Z_TYPE_P(zv_timezone) == IS_OBJECT &&
@@ -172,7 +172,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
 
                php_timezone_obj *tzobj = Z_PHPTIMEZONE_P(zv_timezone);
 
-               zval_dtor(&local_zv_tz);
+               zval_ptr_dtor_str(&local_zv_tz);
                return timezone_convert_datetimezone(tzobj->type, tzobj, 0,
                        outside_error, func);
        } else {
@@ -188,7 +188,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
                                intl_errors_set(outside_error, status, message, 1);
                                efree(message);
                        }
-                       zval_dtor(&local_zv_tz);
+                       zval_ptr_dtor_str(&local_zv_tz);
                        return NULL;
                }
                timeZone = TimeZone::createTimeZone(id);
@@ -198,7 +198,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
                                intl_errors_set(outside_error, U_MEMORY_ALLOCATION_ERROR, message, 1);
                                efree(message);
                        }
-                       zval_dtor(&local_zv_tz);
+                       zval_ptr_dtor_str(&local_zv_tz);
                        return NULL;
                }
                if (timeZone->getID(gottenId) != id) {
@@ -208,13 +208,13 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
                                intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
                                efree(message);
                        }
-                       zval_dtor(&local_zv_tz);
+                       zval_ptr_dtor_str(&local_zv_tz);
                        delete timeZone;
                        return NULL;
                }
        }
 
-       zval_dtor(&local_zv_tz);
+       zval_ptr_dtor_str(&local_zv_tz);
 
        return timeZone;
 }
index 24de8f6544f93f39a6e4381b4296ff9660e04755..3c58b433247bfcac89727f191889f588228c355a 100644 (file)
@@ -202,7 +202,7 @@ err:
 #define TRANSLITERATOR_PROPERTY_HANDLER_EPILOG \
        if( member == &tmp_member )                                     \
        {                                                                                       \
-               zval_dtor( &tmp_member );                               \
+               zval_ptr_dtor_str( &tmp_member );               \
        }
 
 /* {{{ get_property_ptr_ptr handler */
index f0e5dcd2e88a0bc6caf24498d0ad4a5d88881b5b..6267b383ae3cab5ed91fcbd5e52525329e536b20 100644 (file)
@@ -281,7 +281,7 @@ PHP_FUNCTION( transliterator_list_ids )
        intl_error_set_code( NULL, status );
        if( U_FAILURE( status ) )
        {
-               zval_dtor( return_value );
+               zend_array_destroy( Z_ARR_P(return_value) );
                RETVAL_FALSE;
                intl_error_set_custom_msg( NULL, "transliterator_list_ids: "
                        "Failed to build array of registered transliterators", 0 );
index 30923b3350385bd2282ac65691afa105adc70eda..f81f2b65e4a6895b6e9d920afe7ee6b9ae0acc58 100644 (file)
@@ -1814,7 +1814,7 @@ PHP_FUNCTION(ldap_get_entries)
 
        ldap_result_entry = ldap_first_entry(ldap, ldap_result);
        if (ldap_result_entry == NULL) {
-               zval_dtor(return_value);
+               zend_array_destroy(Z_ARR_P(return_value));
                RETURN_FALSE;
        }
 
index 4d3e44f1ec2ce7c187c8b8d691aa949d2812b871..608cdc9d8f8e0971f2998be5f15e550890fc489c 100644 (file)
@@ -986,7 +986,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
                                smart_str_appendl(&out_buf, Z_STRVAL(v), Z_STRLEN(v));
                                /* Clean up */
                                smart_str_free(&eval_buf);
-                               zval_dtor(&v);
+                               zval_ptr_dtor_str(&v);
                        } else if (is_callable) {
                                zval args[1];
                                zval subpats, retval;
@@ -1146,7 +1146,7 @@ PHP_FUNCTION(mb_split)
                OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
                onig_error_code_to_str(err_str, err);
                php_error_docref(NULL, E_WARNING, "mbregex search failure in mbsplit(): %s", err_str);
-               zval_dtor(return_value);
+               zend_array_destroy(Z_ARR_P(return_value));
                RETURN_FALSE;
        }
 
index c885be61c089852a97f2bd49ed0460a9ada5d934..06a170b3061f982ef65132c3750961c7b52a955f 100644 (file)
@@ -325,7 +325,7 @@ zval *mysqli_read_property(zval *object, zval *member, int type, void **cache_sl
        }
 
        if (member == &tmp_member) {
-               zval_dtor(member);
+               zval_ptr_dtor_str(&tmp_member);
        }
 
        return retval;
@@ -357,7 +357,7 @@ void mysqli_write_property(zval *object, zval *member, zval *value, void **cache
        }
 
        if (member == &tmp_member) {
-               zval_dtor(member);
+               zval_ptr_dtor_str(&tmp_member);
        }
 }
 /* }}} */
index b436f23ac0b3fb3b02e64c0deb3c452380ede2c5..e3eac9dfe13e5534b559d83fcdfd72bbbe6faae0 100644 (file)
@@ -1715,10 +1715,10 @@ MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES * result, const unsigned int
        array_init_size(return_value, mysqlnd_num_fields(result) * 2);
        if (FAIL == result->m.fetch_row(result, (void *)return_value, flags, &fetched_anything)) {
                php_error_docref(NULL, E_WARNING, "Error while reading a row");
-               zval_dtor(return_value);
+               zend_array_destroy(Z_ARR_P(return_value));
                RETVAL_FALSE;
        } else if (fetched_anything == FALSE) {
-               zval_dtor(return_value);
+               zend_array_destroy(Z_ARR_P(return_value));
                switch (extension) {
                        case MYSQLND_MYSQLI:
                                RETVAL_NULL();
index 4aae81dbd7478eb0238a73c7ed1b32f15821e803..ca7e512efd649f381077cf1ca95d229831467775 100644 (file)
@@ -3730,7 +3730,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(
 
 #define TMP_CLEAN \
        if (Z_TYPE(tmp) == IS_STRING) {\
-               zval_dtor(&tmp); \
+               zval_ptr_dtor_str(&tmp); \
        } \
        return NULL;
 
@@ -3796,7 +3796,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(
                                TMP_CLEAN;
                        } else {
                                if (Z_TYPE(tmp) == IS_STRING) {
-                                       zval_dtor(&tmp);
+                                       zval_ptr_dtor_str(&tmp);
                                }
                                /* got the key - return it */
                                return (EVP_PKEY*)what;
@@ -3885,7 +3885,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(
                *resourceval = zend_register_resource(key, le_key);
        }
        if (Z_TYPE(tmp) == IS_STRING) {
-               zval_dtor(&tmp);
+               zval_ptr_dtor_str(&tmp);
        }
        return key;
 }
index fbd2b12de493c0fc4a106d83f6e51840de59a5c5..b4f08a87a3f58fe2c27af115deee7bbb086db6dc 100644 (file)
@@ -915,7 +915,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
                                        }
 
                                        do_fetch_class_prepare(stmt);
-                                       zval_dtor(&val);
+                                       zval_ptr_dtor_str(&val);
                                }
                                ce = stmt->fetch.cls.ce;
                                if (!ce) {
index a979ab518238ccdf4f4a029644ed4a40826c6fcc..a75abf965c82c1fd32ffe988b4ce7a6b403a5b0a 100644 (file)
@@ -2911,7 +2911,7 @@ PHP_FUNCTION(pg_fetch_all)
        pgsql_result = pg_result->result;
        array_init(return_value);
        if (php_pgsql_result2array(pgsql_result, return_value, result_type) == FAILURE) {
-               zval_dtor(return_value);
+               zend_array_destroy(Z_ARR_P(return_value));
                RETURN_FALSE;
        }
 }
@@ -4278,12 +4278,12 @@ PHP_FUNCTION(pg_copy_from)
                                        }
                                        if (PQputCopyData(pgsql, query, (int)strlen(query)) != 1) {
                                                efree(query);
-                                               zval_dtor(&tmp);
+                                               zval_ptr_dtor_str(&tmp);
                                                PHP_PQ_ERROR("copy failed: %s", pgsql);
                                                RETURN_FALSE;
                                        }
                                        efree(query);
-                                       zval_dtor(&tmp);
+                                       zval_ptr_dtor_str(&tmp);
                                } ZEND_HASH_FOREACH_END();
 
                                if (PQputCopyEnd(pgsql, NULL) != 1) {
@@ -4302,12 +4302,12 @@ PHP_FUNCTION(pg_copy_from)
                                        }
                                        if (PQputline(pgsql, query)==EOF) {
                                                efree(query);
-                                               zval_dtor(&tmp);
+                                               zval_ptr_dtor_str(&tmp);
                                                PHP_PQ_ERROR("copy failed: %s", pgsql);
                                                RETURN_FALSE;
                                        }
                                        efree(query);
-                                       zval_dtor(&tmp);
+                                       zval_ptr_dtor_str(&tmp);
                                } ZEND_HASH_FOREACH_END();
 
                                if (PQputline(pgsql, "\\.\n") == EOF) {
@@ -5636,7 +5636,7 @@ PHP_FUNCTION(pg_meta_data)
 
        array_init(return_value);
        if (php_pgsql_meta_data(pgsql, table_name, return_value, extended) == FAILURE) {
-               zval_dtor(return_value); /* destroy array */
+               zend_array_destroy(Z_ARR_P(return_value)); /* destroy array */
                RETURN_FALSE;
        }
 }
@@ -6520,7 +6520,7 @@ PHP_FUNCTION(pg_convert)
        }
        array_init(return_value);
        if (php_pgsql_convert(pg_link, table_name, values, return_value, option) == FAILURE) {
-               zval_dtor(return_value);
+               zend_array_destroy(Z_ARR_P(return_value));
                RETURN_FALSE;
        }
 }
index 5f866c6b2ae3aec27f5929f047b70d2f0484cc1c..f2fd4262415aec417514571092c5e925d0315bd2 100644 (file)
@@ -1448,7 +1448,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */
                                str_key = estrndup(Z_STRVAL(key), str_key_len);
 
                                save = str_key;
-                               zval_dtor(&key);
+                               zval_ptr_dtor_str(&key);
                        } else {
                                zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid key (must return a string)", ZSTR_VAL(ce->name));
                                return ZEND_HASH_APPLY_STOP;
@@ -1576,7 +1576,7 @@ phar_spl_fileinfo:
                        str_key = estrndup(Z_STRVAL(key), str_key_len);
 
                        save = str_key;
-                       zval_dtor(&key);
+                       zval_ptr_dtor_str(&key);
                } else {
                        zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid key (must return a string)", ZSTR_VAL(ce->name));
                        return ZEND_HASH_APPLY_STOP;
index e7fdc1bf3bb7a6da704a7d045af8b48609d17461..0d8edde4e2b3543ceb8a8a2e6429ef7b50f5b36d 100644 (file)
@@ -1097,7 +1097,7 @@ PHP_FUNCTION(posix_getgrnam)
        array_init(return_value);
 
        if (!php_posix_group_to_array(g, return_value)) {
-               zval_dtor(return_value);
+               zend_array_destroy(Z_ARR_P(return_value));
                php_error_docref(NULL, E_WARNING, "unable to convert posix group to array");
                RETVAL_FALSE;
        }
@@ -1150,7 +1150,7 @@ PHP_FUNCTION(posix_getgrgid)
        array_init(return_value);
 
        if (!php_posix_group_to_array(g, return_value)) {
-               zval_dtor(return_value);
+               zend_array_destroy(Z_ARR_P(return_value));
                php_error_docref(NULL, E_WARNING, "unable to convert posix group struct to array");
                RETVAL_FALSE;
        }
@@ -1217,7 +1217,7 @@ PHP_FUNCTION(posix_getpwnam)
        array_init(return_value);
 
        if (!php_posix_passwd_to_array(pw, return_value)) {
-               zval_dtor(return_value);
+               zend_array_destroy(Z_ARR_P(return_value));
                php_error_docref(NULL, E_WARNING, "unable to convert posix passwd struct to array");
                RETVAL_FALSE;
        }
@@ -1268,7 +1268,7 @@ PHP_FUNCTION(posix_getpwuid)
        array_init(return_value);
 
        if (!php_posix_passwd_to_array(pw, return_value)) {
-               zval_dtor(return_value);
+               zend_array_destroy(Z_ARR_P(return_value));
                php_error_docref(NULL, E_WARNING, "unable to convert posix passwd struct to array");
                RETVAL_FALSE;
        }
@@ -1387,7 +1387,7 @@ PHP_FUNCTION(posix_getrlimit)
 
        for (l=limits; l->name; l++) {
                if (posix_addlimit(l->limit, l->name, return_value) == FAILURE) {
-                       zval_dtor(return_value);
+                       zend_array_destroy(Z_ARR_P(return_value));
                        RETURN_FALSE;
                }
        }
index 03590d47e7b3556baa28823e5fd0a2177eba14f1..a793536d8d76bde89bf7171ba565b055f52f0e86 100644 (file)
@@ -1452,7 +1452,7 @@ ZEND_METHOD(reflection, export)
        /* Invoke the __toString() method */
        ZVAL_STRINGL(&fname, "__tostring", sizeof("__tostring") - 1);
        result= call_user_function(NULL, object, &fname, &retval, 0, NULL);
-       zval_dtor(&fname);
+       zval_ptr_dtor_str(&fname);
 
        if (result == FAILURE) {
                _DO_THROW("Invocation of method __toString() failed");
@@ -2976,7 +2976,7 @@ ZEND_METHOD(reflection_method, __construct)
                                zend_throw_exception_ex(reflection_exception_ptr, 0,
                                                "Class %s does not exist", Z_STRVAL_P(classname));
                                if (classname == &ztmp) {
-                                       zval_dtor(&ztmp);
+                                       zval_ptr_dtor_str(&ztmp);
                                }
                                return;
                        }
@@ -2988,14 +2988,14 @@ ZEND_METHOD(reflection_method, __construct)
 
                default:
                        if (classname == &ztmp) {
-                               zval_dtor(&ztmp);
+                               zval_ptr_dtor_str(&ztmp);
                        }
                        _DO_THROW("The parameter class is expected to be either a string or an object");
                        /* returns out of this function */
        }
 
        if (classname == &ztmp) {
-               zval_dtor(&ztmp);
+               zval_ptr_dtor_str(&ztmp);
        }
 
        lcname = zend_str_tolower_dup(name_str, name_len);
index b8a895c504581bab853d18e8d8f009180a801c4f..609542d51cea36f95585dfbe0aaeeda133bec924 100644 (file)
@@ -1814,7 +1814,7 @@ static PHP_FUNCTION(session_module_name)
                if (!_php_find_ps_module(ZSTR_VAL(name))) {
                        php_error_docref(NULL, E_WARNING, "Cannot find named PHP session module (%s)", ZSTR_VAL(name));
 
-                       zval_dtor(return_value);
+                       zval_ptr_dtor_str(return_value);
                        RETURN_FALSE;
                }
                if (PS(mod_data) || PS(mod_user_implemented)) {
@@ -2019,7 +2019,7 @@ static PHP_FUNCTION(session_save_path)
        if (name) {
                if (memchr(ZSTR_VAL(name), '\0', ZSTR_LEN(name)) != NULL) {
                        php_error_docref(NULL, E_WARNING, "The save_path cannot contain NULL characters");
-                       zval_dtor(return_value);
+                       zval_ptr_dtor_str(return_value);
                        RETURN_FALSE;
                }
                ini_name = zend_string_init("session.save_path", sizeof("session.save_path") - 1, 0);
index 01eadf98d069b5811c5543fb867194bc064af066..4ff82631e7266f4a0cf5fee5371daf9a6dc1fd3d 100644 (file)
@@ -352,7 +352,7 @@ long_dim:
        }
 
        if (member == &tmp_zv) {
-               zval_dtor(&tmp_zv);
+               zval_ptr_dtor_str(&tmp_zv);
        }
 
        if (Z_ISUNDEF_P(rv)) {
@@ -383,7 +383,6 @@ static zval *sxe_dimension_read(zval *object, zval *offset, int type, zval *rv)
  */
 static void change_node_zval(xmlNodePtr node, zval *value)
 {
-       zval value_copy;
        xmlChar *buffer;
        int buffer_len;
 
@@ -408,9 +407,6 @@ static void change_node_zval(xmlNodePtr node, zval *value)
                                xmlNodeSetContentLen(node, buffer, buffer_len);
                                xmlFree(buffer);
                        }
-                       if (value == &value_copy) {
-                               zval_dtor(value);
-                       }
                        break;
                default:
                        php_error_docref(NULL, E_WARNING, "It is not possible to assign complex types to nodes");
@@ -470,7 +466,7 @@ long_dim:
                        if (!Z_STRLEN_P(member)) {
                                php_error_docref(NULL, E_WARNING, "Cannot write or create unnamed %s", attribs ? "attribute" : "element");
                                if (member == &tmp_zv) {
-                                       zval_dtor(&tmp_zv);
+                                       zval_ptr_dtor_str(&tmp_zv);
                                }
                                return FAILURE;
                        }
@@ -531,7 +527,7 @@ long_dim:
                                /* break is missing intentionally */
                        default:
                                if (member == &tmp_zv) {
-                                       zval_dtor(&tmp_zv);
+                                       zval_ptr_dtor_str(&tmp_zv);
                                }
                                zend_error(E_WARNING, "It is not yet possible to assign complex types to %s", attribs ? "attributes" : "properties");
                                return FAILURE;
@@ -643,7 +639,7 @@ next_iter:
        }
 
        if (member == &tmp_zv) {
-               zval_dtor(&tmp_zv);
+               zval_ptr_dtor_str(&tmp_zv);
        }
        if (pnewnode) {
                *pnewnode = newnode;
@@ -801,7 +797,7 @@ static int sxe_prop_dim_exists(zval *object, zval *member, int check_empty, zend
        }
 
        if (member == &tmp_zv) {
-               zval_dtor(&tmp_zv);
+               zval_ptr_dtor_str(&tmp_zv);
        }
 
        return exists;
@@ -926,7 +922,7 @@ next_iter:
        }
 
        if (member == &tmp_zv) {
-               zval_dtor(&tmp_zv);
+               zval_ptr_dtor_str(&tmp_zv);
        }
 }
 /* }}} */
index 291aeb29811f2e3cb2694549867a55431cd64188..feb97356c98ba99d0c7b09cbd27a63be7b2a7a6c 100644 (file)
@@ -336,12 +336,12 @@ double_case:
 
                switch (is_numeric_string(Z_STRVAL(lzval), Z_STRLEN(lzval), &lval, &dval, 0)) {
                case IS_DOUBLE:
-                       zval_dtor(&lzval);
+                       zval_ptr_dtor_str(&lzval);
                        ZVAL_DOUBLE(&lzval, dval);
                        goto double_case;
 
                case IS_LONG:
-                       zval_dtor(&lzval);
+                       zval_ptr_dtor_str(&lzval);
                        ZVAL_LONG(&lzval, lval);
                        goto long_case;
                }
index 578c52d3e9b965355fb71b0848daf1945e8d52c1..6af26434b8d833fa11d280ceed03e5e0ebf5e9da 100644 (file)
@@ -5530,7 +5530,7 @@ PHP_FUNCTION(ini_set)
                        _CHECK_PATH(ZSTR_VAL(varname), ZSTR_LEN(varname), "java.library.path") ||
                        _CHECK_PATH(ZSTR_VAL(varname), ZSTR_LEN(varname), "vpopmail.directory")) {
                        if (php_check_open_basedir(ZSTR_VAL(new_value))) {
-                               zval_dtor(return_value);
+                               zval_ptr_dtor_str(return_value);
                                RETURN_FALSE;
                        }
                }
@@ -5538,7 +5538,7 @@ PHP_FUNCTION(ini_set)
 #undef _CHECK_PATH
 
        if (zend_alter_ini_entry_ex(varname, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0) == FAILURE) {
-               zval_dtor(return_value);
+               zval_ptr_dtor_str(return_value);
                RETURN_FALSE;
        }
 }
@@ -5581,7 +5581,7 @@ PHP_FUNCTION(set_include_path)
        key = zend_string_init("include_path", sizeof("include_path") - 1, 0);
        if (zend_alter_ini_entry_ex(key, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0) == FAILURE) {
                zend_string_release_ex(key, 0);
-               zval_dtor(return_value);
+               zval_ptr_dtor_str(return_value);
                RETURN_FALSE;
        }
        zend_string_release_ex(key, 0);
@@ -6076,7 +6076,7 @@ PHP_FUNCTION(parse_ini_file)
 
        array_init(return_value);
        if (zend_parse_ini_file(&fh, 0, (int)scanner_mode, ini_parser_cb, return_value) == FAILURE) {
-               zval_dtor(return_value);
+               zend_array_destroy(Z_ARR_P(return_value));
                RETURN_FALSE;
        }
 }
@@ -6118,7 +6118,7 @@ PHP_FUNCTION(parse_ini_string)
 
        array_init(return_value);
        if (zend_parse_ini_string(string, 0, (int)scanner_mode, ini_parser_cb, return_value) == FAILURE) {
-               zval_dtor(return_value);
+               zend_array_destroy(Z_ARR_P(return_value));
                RETVAL_FALSE;
        }
        efree(string);
index f93fb0dbb584f12ccef852fb7651b2f73d8b46e2..b170d1a7b467d38088512fdb92bbdef2da4e7709 100644 (file)
@@ -545,7 +545,7 @@ no_results:
        globfree(&globbuf);
 
        if (basedir_limit && !zend_hash_num_elements(Z_ARRVAL_P(return_value))) {
-               zval_dtor(return_value);
+               zend_array_destroy(Z_ARR_P(return_value));
                RETURN_FALSE;
        }
 }
index 614bc321190158defd91631476192439aa9a83af..a3bbb6d91c9f72d7b61b0e3373b8dd4e648c9025 100644 (file)
@@ -921,13 +921,13 @@ PHP_FUNCTION(dns_get_record)
 #if defined(HAVE_DNS_SEARCH)
                        handle = dns_open(NULL);
                        if (handle == NULL) {
-                               zval_dtor(return_value);
+                               zend_array_destroy(Z_ARR_P(return_value));
                                RETURN_FALSE;
                        }
 #elif defined(HAVE_RES_NSEARCH)
                    memset(&state, 0, sizeof(state));
                    if (res_ninit(handle)) {
-                       zval_dtor(return_value);
+                       zend_array_destroy(Z_ARR_P(return_value));
                                RETURN_FALSE;
                        }
 #else
@@ -954,7 +954,7 @@ PHP_FUNCTION(dns_get_record)
                                        default:
                                                php_error_docref(NULL, E_WARNING, "DNS Query failed");
                                }
-                               zval_dtor(return_value);
+                               zend_array_destroy(Z_ARR_P(return_value));
                                RETURN_FALSE;
                        }
 
@@ -971,7 +971,7 @@ PHP_FUNCTION(dns_get_record)
                                n = dn_skipname(cp, end);
                                if (n < 0) {
                                        php_error_docref(NULL, E_WARNING, "Unable to parse DNS data received");
-                                       zval_dtor(return_value);
+                                       zend_array_destroy(Z_ARR_P(return_value));
                                        php_dns_free_handle(handle);
                                        RETURN_FALSE;
                                }
index 4bca7128a1bf46640062d4788a61e7f23b42fd0b..41f8d1e15934d20270b3158577c443043664a234 100644 (file)
@@ -457,7 +457,7 @@ PHP_FUNCTION(dns_get_record)
                                        continue;
                                } else {
                                        php_error_docref(NULL, E_WARNING, "DNS Query failed");
-                                       zval_dtor(return_value);
+                                       zend_array_destroy(Z_ARR_P(return_value));
                                        RETURN_FALSE;
                                }
                        }
index 643876acb9e1736b00139480a318199d09193613..5ed42dd2e5edda6fb59b764eccf081d1e9f72537 100644 (file)
@@ -2190,7 +2190,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
                                                                        if ((size_t)temp_len > (size_t)(limit - buf)) {
                                                                                goto quit_loop_2;
                                                                        }
-                                                                       zval_dtor(return_value);
+                                                                       zend_array_destroy(Z_ARR_P(return_value));
                                                                        RETVAL_FALSE;
                                                                        goto out;
                                                                }
index 846f404af667075ba262e93add65a2d7b73daad9..e467cf89540b9a30619fdaac0d44073b3bc35ca8 100644 (file)
@@ -850,7 +850,7 @@ PHP_FUNCTION(unpack)
                                break;
 #else
                                php_error_docref(NULL, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP");
-                               zval_dtor(return_value);
+                               zend_array_destroy(Z_ARR_P(return_value));
                                RETURN_FALSE;
 #endif
 
@@ -870,14 +870,14 @@ PHP_FUNCTION(unpack)
 
                        default:
                                php_error_docref(NULL, E_WARNING, "Invalid format type %c", type);
-                               zval_dtor(return_value);
+                               zend_array_destroy(Z_ARR_P(return_value));
                                RETURN_FALSE;
                                break;
                }
 
                if (size != 0 && size != -1 && size < 0) {
                        php_error_docref(NULL, E_WARNING, "Type %c: integer overflow", type);
-                       zval_dtor(return_value);
+                       zend_array_destroy(Z_ARR_P(return_value));
                        RETURN_FALSE;
                }
 
@@ -896,7 +896,7 @@ PHP_FUNCTION(unpack)
 
                        if (size != 0 && size != -1 && INT_MAX - size + 1 < inputpos) {
                                php_error_docref(NULL, E_WARNING, "Type %c: integer overflow", type);
-                               zval_dtor(return_value);
+                               zend_array_destroy(Z_ARR_P(return_value));
                                RETURN_FALSE;
                        }
 
@@ -1192,7 +1192,7 @@ PHP_FUNCTION(unpack)
                                break;
                        } else {
                                php_error_docref(NULL, E_WARNING, "Type %c: not enough input, need %d, have " ZEND_LONG_FMT, type, size, inputlen - inputpos);
-                               zval_dtor(return_value);
+                               zend_array_destroy(Z_ARR_P(return_value));
                                RETURN_FALSE;
                        }
                }
index 14335ba1b4f640e0ad01b247242d2d95cedc7901..46d1b2df65cb231fb966ccddc0b8c65ac90615e4 100644 (file)
@@ -680,7 +680,7 @@ static int php_var_serialize_call_sleep(zval *retval, zval *struc) /* {{{ */
        BG(serialize_lock)++;
        res = call_user_function(CG(function_table), struc, &fname, retval, 0, 0);
        BG(serialize_lock)--;
-       zval_dtor(&fname);
+       zval_ptr_dtor_str(&fname);
 
        if (res == FAILURE || Z_ISUNDEF_P(retval)) {
                zval_ptr_dtor(retval);
index 60df34439535cbe6fa40d36f3f0b20b6f7e85075..dae79c017324ddd07c00cc95f7455fdc7cc43ed8 100644 (file)
@@ -148,7 +148,7 @@ static zend_bool tokenize(zval *return_value, zend_string *source)
                add_token(return_value, token_type, zendtext, zendleng, token_line);
 
                if (Z_TYPE(token) != IS_UNDEF) {
-                       zval_dtor(&token);
+                       zval_ptr_dtor_nogc(&token);
                        ZVAL_UNDEF(&token);
                }
 
@@ -177,7 +177,7 @@ static zend_bool tokenize(zval *return_value, zend_string *source)
                token_line = CG(zend_lineno);
        }
 
-       zval_dtor(&source_zval);
+       zval_ptr_dtor_str(&source_zval);
        zend_restore_lexical_state(&original_lex_state);
 
        return 1;
@@ -255,7 +255,7 @@ static zend_bool tokenize_parse(zval *return_value, zend_string *source)
        zend_restore_lexical_state(&original_lex_state);
        CG(in_compilation) = original_in_compilation;
 
-       zval_dtor(&source_zval);
+       zval_ptr_dtor_str(&source_zval);
 
        return success;
 }
index 6dde04f4e555489513eda0a9a9b26d40719383ca..a7596a5f275bdfd2fb5d364d48dd8caa73557e5e 100644 (file)
@@ -305,7 +305,7 @@ PS_SERIALIZER_DECODE_FUNC(wddx)
        ZVAL_UNDEF(&retval);
        if ((ret = php_wddx_deserialize_ex(val, vallen, &retval)) == SUCCESS) {
                if (Z_TYPE(retval) != IS_ARRAY) {
-                       zval_dtor(&retval);
+                       zval_ptr_dtor_nogc(&retval);
                        return FAILURE;
                }
                ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL(retval), idx, key, ent) {
@@ -1065,7 +1065,7 @@ static void php_wddx_process_data(void *user_data, const XML_Char *s, int len)
                                        memcpy(ZSTR_VAL(str), Z_STRVAL(ent->data), Z_STRLEN(ent->data));
                                        memcpy(ZSTR_VAL(str) + Z_STRLEN(ent->data), s, len);
                                        ZSTR_VAL(str)[ZSTR_LEN(str)] = '\0';
-                                       zval_dtor(&ent->data);
+                                       zval_ptr_dtor_str(&ent->data);
                                } else {
                                        str = zend_string_init((char *)s, len, 0);
                                }
index 0b84a702b8c3966cf1efbf0659921edc3308ab60..38343e514ba2902fbe0050075cd688814bfd08c0 100644 (file)
@@ -139,7 +139,7 @@ zval *xmlreader_get_property_ptr_ptr(zval *object, zval *member, int type, void
        }
 
        if (member == &tmp_member) {
-               zval_dtor(member);
+               zval_ptr_dtor_str(&tmp_member);
        }
 
        return retval;
@@ -176,7 +176,7 @@ zval *xmlreader_read_property(zval *object, zval *member, int type, void **cache
        }
 
        if (member == &tmp_member) {
-               zval_dtor(member);
+               zval_ptr_dtor_str(&tmp_member);
        }
        return retval;
 }
@@ -206,7 +206,7 @@ void xmlreader_write_property(zval *object, zval *member, zval *value, void **ca
        }
 
        if (member == &tmp_member) {
-               zval_dtor(member);
+               zval_ptr_dtor_str(&tmp_member);
        }
 }
 /* }}} */
index d355ca3425bbd7f3dcf62a70acde618b252d3bf7..24dd0020d61b0184d219b298621868531f3f7d7c 100644 (file)
@@ -896,7 +896,7 @@ static zval *php_zip_get_property_ptr_ptr(zval *object, zval *member, int type,
        }
 
        if (member == &tmp_member) {
-               zval_dtor(member);
+               zval_ptr_dtor_str(&tmp_member);
        }
 
        return retval;
@@ -932,7 +932,7 @@ static zval *php_zip_read_property(zval *object, zval *member, int type, void **
        }
 
        if (member == &tmp_member) {
-               zval_dtor(member);
+               zval_ptr_dtor_str(&tmp_member);
        }
 
        return retval;
@@ -977,7 +977,7 @@ static int php_zip_has_property(zval *object, zval *member, int type, void **cac
        }
 
        if (member == &tmp_member) {
-               zval_dtor(member);
+               zval_ptr_dtor_str(&tmp_member);
        }
 
        return retval;
@@ -1743,7 +1743,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
                                        if ((add_path_len + file_stripped_len) > MAXPATHLEN) {
                                                php_error_docref(NULL, E_WARNING, "Entry name too long (max: %d, %zd given)",
                                                MAXPATHLEN - 1, (add_path_len + file_stripped_len));
-                                               zval_ptr_dtor(return_value);
+                                               zend_array_destroy(Z_ARR_P(return_value));
                                                RETURN_FALSE;
                                        }
                                        snprintf(entry_name_buf, MAXPATHLEN, "%s%s", add_path, file_stripped);
@@ -1760,7 +1760,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
 
                                if (php_zip_add_file(intern, Z_STRVAL_P(zval_file), Z_STRLEN_P(zval_file),
                                        entry_name, entry_name_len, 0, 0) < 0) {
-                                       zval_dtor(return_value);
+                                       zend_array_destroy(Z_ARR_P(return_value));
                                        RETURN_FALSE;
                                }
                        }
index d7bc81348d2a275f1a044027a1dd36e56f0f1507..122e30bf9c80320db487a351d9b192975d21fa88 100644 (file)
@@ -87,7 +87,7 @@ PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars
 
        if (!symtable1) {
                /* Nothing to do */
-               zval_dtor(val);
+               zval_ptr_dtor_nogc(val);
                return;
        }
 
@@ -118,7 +118,7 @@ PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars
        var_len = p - var;
 
        if (var_len==0) { /* empty variable name, or variable name with a space in it */
-               zval_dtor(val);
+               zval_ptr_dtor_nogc(val);
                free_alloca(var_orig, use_heap);
                return;
        }
@@ -132,7 +132,7 @@ PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars
                                                && ex->symbol_table == symtable1) {
                                        if (memcmp(var, "this", sizeof("this")-1) == 0) {
                                                zend_throw_error(NULL, "Cannot re-assign $this");
-                                               zval_dtor(val);
+                                               zval_ptr_dtor_nogc(val);
                                                free_alloca(var_orig, use_heap);
                                                return;
                                        }
@@ -147,7 +147,7 @@ PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars
        if (symtable1 == &EG(symbol_table) &&
                var_len == sizeof("GLOBALS")-1 &&
                !memcmp(var, "GLOBALS", sizeof("GLOBALS")-1)) {
-               zval_dtor(val);
+               zval_ptr_dtor_nogc(val);
                free_alloca(var_orig, use_heap);
                return;
        }
@@ -170,7 +170,7 @@ PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars
                                        zend_symtable_str_del(ht, var, var_len);
                                }
 
-                               zval_dtor(val);
+                               zval_ptr_dtor_nogc(val);
 
                                /* do not output the error message to the screen,
                                 this helps us to to avoid "information disclosure" */
@@ -208,8 +208,8 @@ PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars
                        if (!index) {
                                array_init(&gpc_element);
                                if ((gpc_element_p = zend_hash_next_index_insert(symtable1, &gpc_element)) == NULL) {
-                                       zval_ptr_dtor(&gpc_element);
-                                       zval_dtor(val);
+                                       zend_array_destroy(Z_ARR(gpc_element));
+                                       zval_ptr_dtor_nogc(val);
                                        free_alloca(var_orig, use_heap);
                                        return;
                                }
@@ -224,7 +224,7 @@ PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars
                                                gpc_element_p = Z_INDIRECT_P(gpc_element_p);
                                        }
                                        if (Z_TYPE_P(gpc_element_p) != IS_ARRAY) {
-                                               zval_ptr_dtor(gpc_element_p);
+                                               zval_ptr_dtor_nogc(gpc_element_p);
                                                array_init(gpc_element_p);
                                        }
                                }
@@ -246,7 +246,7 @@ PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars
 plain_var:
                if (!index) {
                        if (zend_hash_next_index_insert(symtable1, val) == NULL) {
-                               zval_ptr_dtor(val);
+                               zval_ptr_dtor_nogc(val);
                        }
                } else {
                        zend_ulong idx;
@@ -260,7 +260,7 @@ plain_var:
                        if (Z_TYPE(PG(http_globals)[TRACK_VARS_COOKIE]) != IS_UNDEF &&
                                symtable1 == Z_ARRVAL(PG(http_globals)[TRACK_VARS_COOKIE]) &&
                                zend_symtable_str_exists(symtable1, index, index_len)) {
-                               zval_ptr_dtor(val);
+                               zval_ptr_dtor_nogc(val);
                        } else if (ZEND_HANDLE_NUMERIC_STR(index, index_len, idx)) {
                                zend_hash_index_update(symtable1, idx, val);
                        } else {
@@ -418,15 +418,15 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data)
                        array_init(&array);
                        switch (arg) {
                                case PARSE_POST:
-                                       zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_POST]);
+                                       zval_ptr_dtor_nogc(&PG(http_globals)[TRACK_VARS_POST]);
                                        ZVAL_COPY_VALUE(&PG(http_globals)[TRACK_VARS_POST], &array);
                                        break;
                                case PARSE_GET:
-                                       zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_GET]);
+                                       zval_ptr_dtor_nogc(&PG(http_globals)[TRACK_VARS_GET]);
                                        ZVAL_COPY_VALUE(&PG(http_globals)[TRACK_VARS_GET], &array);
                                        break;
                                case PARSE_COOKIE:
-                                       zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_COOKIE]);
+                                       zval_ptr_dtor_nogc(&PG(http_globals)[TRACK_VARS_COOKIE]);
                                        ZVAL_COPY_VALUE(&PG(http_globals)[TRACK_VARS_COOKIE], &array);
                                        break;
                        }
@@ -654,7 +654,7 @@ static inline void php_register_server_variables(void)
        zval *arr = &PG(http_globals)[TRACK_VARS_SERVER];
        HashTable *ht;
 
-       zval_ptr_dtor(arr);
+       zval_ptr_dtor_nogc(arr);
        array_init(arr);
 
        /* Server variables */
@@ -736,7 +736,7 @@ static zend_bool php_auto_globals_create_get(zend_string *name)
        if (PG(variables_order) && (strchr(PG(variables_order),'G') || strchr(PG(variables_order),'g'))) {
                sapi_module.treat_data(PARSE_GET, NULL, NULL);
        } else {
-               zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_GET]);
+               zval_ptr_dtor_nogc(&PG(http_globals)[TRACK_VARS_GET]);
                array_init(&PG(http_globals)[TRACK_VARS_GET]);
        }
 
@@ -755,7 +755,7 @@ static zend_bool php_auto_globals_create_post(zend_string *name)
                !strcasecmp(SG(request_info).request_method, "POST")) {
                sapi_module.treat_data(PARSE_POST, NULL, NULL);
        } else {
-               zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_POST]);
+               zval_ptr_dtor_nogc(&PG(http_globals)[TRACK_VARS_POST]);
                array_init(&PG(http_globals)[TRACK_VARS_POST]);
        }
 
@@ -770,7 +770,7 @@ static zend_bool php_auto_globals_create_cookie(zend_string *name)
        if (PG(variables_order) && (strchr(PG(variables_order),'C') || strchr(PG(variables_order),'c'))) {
                sapi_module.treat_data(PARSE_COOKIE, NULL, NULL);
        } else {
-               zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_COOKIE]);
+               zval_ptr_dtor_nogc(&PG(http_globals)[TRACK_VARS_COOKIE]);
                array_init(&PG(http_globals)[TRACK_VARS_COOKIE]);
        }
 
@@ -829,7 +829,7 @@ static zend_bool php_auto_globals_create_server(zend_string *name)
                }
 
        } else {
-               zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_SERVER]);
+               zval_ptr_dtor_nogc(&PG(http_globals)[TRACK_VARS_SERVER]);
                array_init(&PG(http_globals)[TRACK_VARS_SERVER]);
        }
 
@@ -847,7 +847,7 @@ static zend_bool php_auto_globals_create_server(zend_string *name)
 
 static zend_bool php_auto_globals_create_env(zend_string *name)
 {
-       zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_ENV]);
+       zval_ptr_dtor_nogc(&PG(http_globals)[TRACK_VARS_ENV]);
        array_init(&PG(http_globals)[TRACK_VARS_ENV]);
 
        if (PG(variables_order) && (strchr(PG(variables_order),'E') || strchr(PG(variables_order),'e'))) {
index 2a76f23763ea697d845b5e626d6c4ce3fadf2258..ac1f5cba7aa52e0e440b46099ca8a9bca0cf3556 100644 (file)
@@ -1214,7 +1214,7 @@ fmt_error:
                        if (adjust_width && adjust == LEFT && (size_t)min_width > s_len)
                                PAD((size_t)min_width, s_len, pad_char);
                        if (free_zcopy) {
-                               zval_dtor(&zcopy);
+                               zval_ptr_dtor_str(&zcopy);
                        }
                }
 skip_output:
index 10bce9d2471b3485a8ee72e57b7d60ad1c59a003..bcd2111937ddf89dc9ed5f21f2874d019c8b730c 100644 (file)
@@ -817,7 +817,7 @@ fmt_error:
                        }
 
                        if (free_zcopy) {
-                               zval_dtor(&zcopy);
+                               zval_ptr_dtor_str(&zcopy);
                        }
                }
 skip_output:
index 8f2ab71cca6fb131ad7fd6cff13cfc0f4360764d..79478af0c6a39c16c9d0b28b861209208f22c90e 100644 (file)
@@ -247,14 +247,14 @@ static void litespeed_php_import_environment_variables(zval *array_ptr)
         Z_ARR_P(array_ptr) != Z_ARR(PG(http_globals)[TRACK_VARS_ENV]) &&
         zend_hash_num_elements(Z_ARRVAL(PG(http_globals)[TRACK_VARS_ENV])) > 0
     ) {
-        zval_dtor(array_ptr);
+        zval_ptr_dtor_nogc(array_ptr);
         ZVAL_DUP(array_ptr, &PG(http_globals)[TRACK_VARS_ENV]);
         return;
     } else if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY &&
         Z_ARR_P(array_ptr) != Z_ARR(PG(http_globals)[TRACK_VARS_SERVER]) &&
         zend_hash_num_elements(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER])) > 0
     ) {
-        zval_dtor(array_ptr);
+        zval_ptr_dtor_nogc(array_ptr);
         ZVAL_DUP(array_ptr, &PG(http_globals)[TRACK_VARS_SERVER]);
         return;
     }
index c104b0dc528527a36fb413f231701585bb818b0a..a10d652e338fb7b8b5d3acbedfcb150f45a0173b 100644 (file)
@@ -840,7 +840,7 @@ static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, co
 
        new_break.ops = zend_compile_string(&pv, "Conditional Breakpoint Code");
 
-       zval_dtor(&pv);
+       zval_ptr_dtor_str(&pv);
 
        if (new_break.ops) {
                brake = zend_hash_index_update_mem(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], hash, &new_break, sizeof(phpdbg_breakcond_t));
index 1f35a3d1d561eb95b4205f3e1e003bfbc2112cbf..545e1c951dbd04df8a8d23a8fb911ff2d3894224 100644 (file)
@@ -799,7 +799,7 @@ fmt_error:
                        if (adjust_width && adjust == LEFT && min_width > s_len)
                                PAD(min_width, s_len, pad_char);
                        if (free_zcopy) {
-                               zval_dtor(&zcopy);
+                               zval_ptr_dtor_str(&zcopy);
                        }
                }
 skip_output:
index 067ae739134a07a67ea1c4069d30e2ac8de44e76..f406810ab94bcd3d9e1712ec2b00a6a8bce3acdd 100644 (file)
@@ -196,7 +196,7 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack) /* {{{ */
                                zval_ptr_dtor(&fretval);
                        }
 
-                       zval_dtor(&fci.function_name);
+                       zval_ptr_dtor_str(&fci.function_name);
                        efree(lc_name);
 
                        return SUCCESS;
index 305a7daf2acddd9d30dee3da90ced731923a26fb..8cfc337916199035b18a6b42087b1bd1dd69ae13 100644 (file)
@@ -26,7 +26,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
 static void phpdbg_rebuild_http_globals_array(int type, const char *name) {
        zval *zvp;
        if (Z_TYPE(PG(http_globals)[type]) != IS_UNDEF) {
-               zval_dtor(&PG(http_globals)[type]);
+               zval_ptr_dtor_nogc(&PG(http_globals)[type]);
        }
        if ((zvp = zend_hash_str_find(&EG(symbol_table), name, strlen(name)))) {
                Z_ADDREF_P(zvp);
index 16c82a6118821810071d732d60955404e92b5dab..a543f98ba7ea8caabbb82be82ec77f07a1dce943 100644 (file)
@@ -171,5 +171,5 @@ PHPDBG_API void phpdbg_webdata_compress(char **msg, size_t *len) {
                *len = ZSTR_LEN(buf.s);
        }
 
-       zval_dtor(&array);
+       zend_array_destroy(Z_ARR(array));
 }