Skip to content

Commit f765c36

Browse files
committed
Zend: Remove useless zval & dtor from define()
1 parent 7b4270a commit f765c36

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Zend/zend_builtin_functions.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ static void copy_constant_array(zval *dst, zval *src) /* {{{ */
555555
ZEND_FUNCTION(define)
556556
{
557557
zend_string *name;
558-
zval *val, val_free;
558+
zval *val;
559559
bool non_cs = 0;
560560
zend_constant c;
561561

@@ -575,8 +575,6 @@ ZEND_FUNCTION(define)
575575
zend_error(E_WARNING, "define(): Argument #3 ($case_insensitive) is ignored since declaration of case-insensitive constants is no longer supported");
576576
}
577577

578-
ZVAL_UNDEF(&val_free);
579-
580578
if (Z_TYPE_P(val) == IS_ARRAY) {
581579
if (Z_REFCOUNTED_P(val)) {
582580
if (!validate_constant_array_argument(Z_ARRVAL_P(val), 2)) {
@@ -589,7 +587,6 @@ ZEND_FUNCTION(define)
589587
}
590588

591589
ZVAL_COPY(&c.value, val);
592-
zval_ptr_dtor(&val_free);
593590

594591
register_constant:
595592
/* non persistent */

0 commit comments

Comments
 (0)