Skip to content

Commit 419c68f

Browse files
author
Andi Gutmans
committed
- Another small fix.
1 parent 0e2f4cc commit 419c68f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Zend/zend_execute.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,16 +1549,18 @@ binary_assign_op_addr: {
15491549

15501550
if (opline->extended_value) {
15511551
retval_ptr_ptr = get_zval_ptr_ptr(&opline->op1, Ts, BP_VAR_R);
1552-
SEPARATE_ZVAL(retval_ptr_ptr);
1553-
(*retval_ptr_ptr)->is_ref = 1;
1552+
1553+
if (!PZVAL_IS_REF(*retval_ptr_ptr)) {
1554+
SEPARATE_ZVAL(retval_ptr_ptr);
1555+
(*retval_ptr_ptr)->is_ref = 1;
1556+
}
15541557
(*retval_ptr_ptr)->refcount++;
15551558
efree(*EG(return_value_ptr_ptr));
15561559
(*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr);
15571560
} else {
15581561
retval_ptr = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
15591562

15601563
if (!EG(free_op1)) { /* Not a temp var */
1561-
15621564
if (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0) {
15631565
**EG(return_value_ptr_ptr) = *retval_ptr;
15641566
(*EG(return_value_ptr_ptr))->is_ref = 0;

0 commit comments

Comments
 (0)