diff options
| author | Dmitry Stogov <dmitry@php.net> | 2006-12-08 15:55:31 +0000 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@php.net> | 2006-12-08 15:55:31 +0000 |
| commit | 108a2fc64c968ba2cee92fb6bb1fe6a493958923 (patch) | |
| tree | aebedd88931c7eb80134323cc335fd94f3a77641 /Zend/zend_object_handlers.c | |
| parent | 1edf208421da4efefa16f09b31cafb7d18597759 (diff) | |
| download | php-git-108a2fc64c968ba2cee92fb6bb1fe6a493958923.tar.gz | |
Fixed bug #39775 ("Indirect modification ..." message is not shown)
The fix breaks two SimpleXML tests those must be fixed
Diffstat (limited to 'Zend/zend_object_handlers.c')
| -rw-r--r-- | Zend/zend_object_handlers.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 92e798c754..221035b8a5 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -334,14 +334,16 @@ zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC) if (rv) { retval = &rv; - if ((type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET) && rv->refcount > 0) { - zval *tmp = rv; - - ALLOC_ZVAL(rv); - *rv = *tmp; - zval_copy_ctor(rv); - rv->is_ref = 0; - rv->refcount = 0; + if (type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET) { + if (rv->refcount > 0) { + zval *tmp = rv; + + ALLOC_ZVAL(rv); + *rv = *tmp; + zval_copy_ctor(rv); + rv->is_ref = 0; + rv->refcount = 0; + } if (Z_TYPE_P(rv) != IS_OBJECT) { zend_error(E_NOTICE, "Indirect modification of overloaded property %s::$%s has no effect", zobj->ce->name, Z_STRVAL_P(member)); } @@ -469,19 +471,6 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type TSRMLS_DC) /* Undo PZVAL_LOCK() */ retval->refcount--; - if ((type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET) && retval->refcount > 0) { - zval *tmp = retval; - - ALLOC_ZVAL(retval); - *retval = *tmp; - zval_copy_ctor(retval); - retval->is_ref = 0; - retval->refcount = 0; - if (Z_TYPE_P(retval) != IS_OBJECT) { - zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ce->name); - } - } - return retval; } else { zend_error(E_ERROR, "Cannot use object of type %s as array", ce->name); |
