From 5abc423112d936e59470d00a022cf667312cc652 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 18 Jan 2005 09:04:43 +0000 Subject: [PATCH] Fixed bug #28444 (Cannot access undefined property for object with overloaded property access). (Dmitry) --- NEWS | 2 ++ Zend/zend_execute.c | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 11a8b7f9c5..58540a4038 100644 --- a/NEWS +++ b/NEWS @@ -35,6 +35,8 @@ PHP NEWS parameters). (Jani) - Fixed bug #28930 (PHP sources pick wrong header files generated by bison). (eggert at gnu dot org, Jani) +- Fixed bug #28444 (Cannot access undefined property for object with overloaded + property access). (Dmitry) - Fixed bug #28074 (FastCGI: stderr should be written in a FCGI stderr stream). (chris at ex-parrot dot com) diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 7251dd323b..40f59fe112 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -175,9 +175,15 @@ static inline void zend_fetch_property_address_inner(zval *object, znode *op2, z if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { zval **ptr_ptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, prop_ptr TSRMLS_CC); if(NULL == ptr_ptr) { - zend_error(E_ERROR, "Cannot access undefined property for object with overloaded property access"); + if (Z_OBJ_HT_P(object)->read_property && + (T(result->u.var).var.ptr = Z_OBJ_HT_P(object)->read_property(object, prop_ptr, BP_VAR_W TSRMLS_CC)) != NULL) { + T(result->u.var).var.ptr_ptr = &T(result->u.var).var.ptr; + } else { + zend_error(E_ERROR, "Cannot access undefined property for object with overloaded property access"); + } + } else { + T(result->u.var).var.ptr_ptr = ptr_ptr; } - T(result->u.var).var.ptr_ptr = ptr_ptr; } else if (Z_OBJ_HT_P(object)->read_property) { T(result->u.var).var.ptr = Z_OBJ_HT_P(object)->read_property(object, prop_ptr, BP_VAR_W TSRMLS_CC); T(result->u.var).var.ptr_ptr = &T(result->u.var).var.ptr; -- 2.50.1