Skip to content

Commit bd8e767

Browse files
committed
Use zval_ptr_dtor() instead of zval_dtor() in in-place array/object conversion functions
1 parent 6a4e1e8 commit bd8e767

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Zend/zend_operators.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ ZEND_API void ZEND_FASTCALL convert_to_long_base(zval *op, int base) /* {{{ */
371371
zval dst;
372372

373373
convert_object_to_type(op, &dst, IS_LONG, convert_to_long);
374-
zval_dtor(op);
374+
zval_ptr_dtor(op);
375375

376376
if (Z_TYPE(dst) == IS_LONG) {
377377
ZVAL_LONG(op, Z_LVAL(dst));
@@ -430,7 +430,7 @@ ZEND_API void ZEND_FASTCALL convert_to_double(zval *op) /* {{{ */
430430
zval dst;
431431

432432
convert_object_to_type(op, &dst, IS_DOUBLE, convert_to_double);
433-
zval_dtor(op);
433+
zval_ptr_dtor(op);
434434

435435
if (Z_TYPE(dst) == IS_DOUBLE) {
436436
ZVAL_DOUBLE(op, Z_DVAL(dst));
@@ -502,7 +502,7 @@ ZEND_API void ZEND_FASTCALL convert_to_boolean(zval *op) /* {{{ */
502502
zval dst;
503503

504504
convert_object_to_type(op, &dst, _IS_BOOL, convert_to_boolean);
505-
zval_dtor(op);
505+
zval_ptr_dtor(op);
506506

507507
if (Z_TYPE_INFO(dst) == IS_FALSE || Z_TYPE_INFO(dst) == IS_TRUE) {
508508
Z_TYPE_INFO_P(op) = Z_TYPE_INFO(dst);
@@ -576,7 +576,7 @@ ZEND_API void ZEND_FASTCALL _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{
576576
zval dst;
577577

578578
convert_object_to_type(op, &dst, IS_STRING, convert_to_string);
579-
zval_dtor(op);
579+
zval_ptr_dtor(op);
580580

581581
if (Z_TYPE(dst) == IS_STRING) {
582582
ZVAL_COPY_VALUE(op, &dst);
@@ -620,7 +620,7 @@ ZEND_API void ZEND_FASTCALL convert_to_array(zval *op) /* {{{ */
620620
(Z_OBJCE_P(op)->default_properties_count ||
621621
Z_OBJ_P(op)->handlers != &std_object_handlers ||
622622
GC_IS_RECURSIVE(obj_ht)));
623-
zval_dtor(op);
623+
zval_ptr_dtor(op);
624624
ZVAL_ARR(op, obj_ht);
625625
return;
626626
}
@@ -629,13 +629,13 @@ ZEND_API void ZEND_FASTCALL convert_to_array(zval *op) /* {{{ */
629629
convert_object_to_type(op, &dst, IS_ARRAY, convert_to_array);
630630

631631
if (Z_TYPE(dst) == IS_ARRAY) {
632-
zval_dtor(op);
632+
zval_ptr_dtor(op);
633633
ZVAL_COPY_VALUE(op, &dst);
634634
return;
635635
}
636636
}
637637

638-
zval_dtor(op);
638+
zval_ptr_dtor(op);
639639
/*ZVAL_EMPTY_ARRAY(op);*/
640640
array_init(op);
641641
}
@@ -667,7 +667,7 @@ ZEND_API void ZEND_FASTCALL convert_to_object(zval *op) /* {{{ */
667667
/* TODO: try not to duplicate immutable arrays as well ??? */
668668
ht = zend_array_dup(ht);
669669
} else if (ht != Z_ARR_P(op)) {
670-
zval_dtor(op);
670+
zval_ptr_dtor(op);
671671
} else {
672672
GC_DELREF(ht);
673673
}

0 commit comments

Comments
 (0)