summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-07-04 19:22:24 +0300
committerDmitry Stogov <dmitry@zend.com>2018-07-04 19:22:24 +0300
commit4a475a4976db92e71949786cdf5990c61514261e (patch)
tree6934c9e00200e6388256656b8fa71c97a1a3a158 /Zend/zend_compile.c
parentd798fd491be77943fb751ad97d85475bf324192c (diff)
downloadphp-git-4a475a4976db92e71949786cdf5990c61514261e.tar.gz
Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized destructors.
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.
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 602d639f25..c050855ae8 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -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)) {