cvs: ZendEngine2 / zend_execute.c zend_object_handlers.c
| From: | Stanislav Malyshev | Date: | Mon, 05 Jan 2004 11:45:47 +0000 |
| Subject: | cvs: ZendEngine2 / zend_execute.c zend_object_handlers.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-2173@lists.php.net to get a copy of this message | ||
stas Mon Jan 5 06:45:47 2004 EDT
Modified files:
/ZendEngine2 zend_object_handlers.c zend_execute.c
Log:
Bug #24608 - fix interaction between __accessors and get_property_ptr
Index: ZendEngine2/zend_object_handlers.c
diff -u ZendEngine2/zend_object_handlers.c:1.87 ZendEngine2/zend_object_handlers.c:1.88
--- ZendEngine2/zend_object_handlers.c:1.87 Sat Jan 3 08:51:01 2004
+++ ZendEngine2/zend_object_handlers.c Mon Jan 5 06:45:46 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_object_handlers.c,v 1.87 2004/01/03 13:51:01 derick Exp $ */
+/* $Id: zend_object_handlers.c,v 1.88 2004/01/05 11:45:46 stas Exp $ */
#include "zend.h"
#include "zend_globals.h"
@@ -457,8 +457,8 @@
if (zend_hash_quick_find(zobj->properties, property_info->name,
property_info->name_length+1, property_info->h, (void **) &retval) == FAILURE) {
zval *new_zval;
- if (!zobj->ce->__get) {
- /* we don't have getter - will just add it */
+ if (!zobj->ce->__get && !zobj->ce->__set) {
+ /* we don't have access controls - will just add it */
new_zval = &EG(uninitialized_zval);
/* zend_error(E_NOTICE, "Undefined property: %s", Z_STRVAL_P(member)); */
Index: ZendEngine2/zend_execute.c
diff -u ZendEngine2/zend_execute.c:1.577 ZendEngine2/zend_execute.c:1.578
--- ZendEngine2/zend_execute.c:1.577 Sat Jan 3 08:51:01 2004
+++ ZendEngine2/zend_execute.c Mon Jan 5 06:45:46 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute.c,v 1.577 2004/01/03 13:51:01 derick Exp $ */
+/* $Id: zend_execute.c,v 1.578 2004/01/05 11:45:46 stas Exp $ */
#define ZEND_INTENSIVE_DEBUGGING 0
@@ -169,7 +169,11 @@
}
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
- T(result->u.var).var.ptr_ptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, prop_ptr
TSRMLS_CC);
+ 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");
+ }
+ 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, 0
TSRMLS_CC);
T(result->u.var).var.ptr_ptr = &T(result->u.var).var.ptr;