Skip to content

Commit 4725a9b

Browse files
committed
Copy comment
1 parent 700559d commit 4725a9b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Zend/zend_execute.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2841,6 +2841,9 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c
28412841
zend_property_info *prop_info = CACHED_PTR_EX(cache_slot + 2);
28422842
if (prop_info) {
28432843
if (UNEXPECTED(prop_info->flags & ZEND_ACC_READONLY)) {
2844+
/* For objects, R/RW/UNSET fetch modes might not actually modify object.
2845+
* Similar as with magic __get() allow them, but return the value as a copy
2846+
* to make sure no actual modification is possible. */
28442847
ZEND_ASSERT(type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET);
28452848
if (Z_TYPE_P(ptr) == IS_OBJECT) {
28462849
ZVAL_COPY(result, ptr);

0 commit comments

Comments
 (0)