Bug #24608 - fix interaction between __accessors and get_property_ptr

This commit is contained in:
Stanislav Malyshev 2004-01-05 11:45:46 +00:00
parent 7baf31fc83
commit 1e11e7401c
2 changed files with 7 additions and 3 deletions

View file

@ -169,7 +169,11 @@ static inline void zend_fetch_property_address_inner(zval *object, znode *op2, z
}
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;

View file

@ -457,8 +457,8 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC
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)); */