]> granicus.if.org Git - php/commitdiff
Fixed bug #28444 (Cannot access undefined property for object with overloaded propert...
authorDmitry Stogov <dmitry@php.net>
Tue, 18 Jan 2005 09:04:43 +0000 (09:04 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 18 Jan 2005 09:04:43 +0000 (09:04 +0000)
NEWS
Zend/zend_execute.c

diff --git a/NEWS b/NEWS
index 11a8b7f9c56bf963ed047d08f38e37ef7fca7c16..58540a4038dbd1f24fc9aa4487ace061de887d40 100644 (file)
--- 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)
   
index 7251dd323b5ef91d08a186341a418db3d0209207..40f59fe112d12cc12f7e2fea3d3581a1be0abe6f 100644 (file)
@@ -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;