com php-src: Temporary fix for reference counting: Zend/zend_ object_handlers.c

From: Date: Fri, 28 Feb 2014 19:42:32 +0000
Subject: com php-src: Temporary fix for reference counting: Zend/zend_ object_handlers.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-77820@lists.php.net to get a copy of this message
Commit: 46ab80b48ef2acedfe8cbd091cae45621224c6f7 Author: Dmitry Stogov <dmitry@zend.com> Fri, 28 Feb 2014 23:42:32 +0400 Parents: 29d61b65274b9aaefba934a82912b90c005f8930 Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=46ab80b48ef2acedfe8cbd091cae45621224c6f7 Log: Temporary fix for reference counting Changed paths: M Zend/zend_object_handlers.c Diff: diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index e86aee1..52b073e 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -482,23 +482,31 @@ zval *zend_std_read_property(zval *object, zval *member, int type, const zend_li if (Z_TYPE_P(rv) != IS_UNDEF) { retval = rv; -//??? -#if 0 if (!Z_ISREF_P(rv) && (type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET)) { - if (Z_REFCOUNT_P(rv) > 0) { - zval *tmp = rv; + if (Z_REFCOUNTED_P(rv) && Z_REFCOUNT_P(rv) > 1) { + + SEPARATE_ZVAL(rv); + +//??? if (Z_TYPE_P(rv) == IS_OBJECT || +//??? Z_TYPE_P(rv) == IS_RESOURCE) { +//??? Z_ADDREF_P(rv); +//??? } else { +//??? zval_copy_ctor(rv); +//??? Z_SET_REFCOUNT_P(rv, 1); +//??? } - ALLOC_ZVAL(rv); - ZVAL_DUP(rv, tmp); - Z_UNSET_ISREF_P(rv); - Z_SET_REFCOUNT_P(rv, 0); +//??? zval *tmp = rv; +//??? +//??? ALLOC_ZVAL(rv); +//??? ZVAL_DUP(rv, tmp); +//??? Z_UNSET_ISREF_P(rv); +//??? Z_SET_REFCOUNT_P(rv, 0); } if (UNEXPECTED(Z_TYPE_P(rv) != IS_OBJECT)) { zend_error(E_NOTICE, "Indirect modification of overloaded property %s::$%s has no effect", zobj->ce->name->val, Z_STRVAL_P(member)); } } -#endif } else { retval = &EG(uninitialized_zval); }

« previous php.cvs (#77820) next »