Skip to content

Commit f2a51d9

Browse files
committed
ext/reflection: fix bug 20873 - cannot assign by reference to overloaded object
1 parent 3b635c2 commit f2a51d9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Zend/zend_execute.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3624,14 +3624,20 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c
36243624
ZVAL_ERROR(result);
36253625
goto end;
36263626
}
3627-
if (Z_TYPE_P(ptr) == IS_NULL && Z_NEXT_P(ptr) == 0) {
3628-
ZVAL_NULL(result);
3627+
if (UNEXPECTED(!Z_REFCOUNTED_P(ptr) && !Z_ISREF_P(ptr) && Z_TYPE_P(ptr) != IS_INDIRECT )) {
3628+
if (Z_TYPE_P(ptr) == IS_FALSE) {
3629+
ZVAL_FALSE(result);
3630+
}
3631+
if (Z_TYPE_P(ptr) == IS_NULL) {
3632+
ZVAL_NULL(result);
3633+
}
36293634
goto end;
36303635
}
36313636
} else if (UNEXPECTED(Z_ISERROR_P(ptr))) {
36323637
ZVAL_ERROR(result);
36333638
goto end;
36343639
}
3640+
36353641
ZVAL_INDIRECT(result, ptr);
36363642
flags &= ZEND_FETCH_OBJ_FLAGS;
36373643
if (flags) {

0 commit comments

Comments
 (0)