diff options
author | George Wang <gwang@php.net> | 2014-10-03 16:43:08 -0400 |
---|---|---|
committer | George Wang <gwang@php.net> | 2014-10-03 16:43:08 -0400 |
commit | ef0eed7f5ff34236b39d9c5914e1627ef30c7cb7 (patch) | |
tree | aa1b356321816109d462cacbb0c7986e3abe3153 /Zend/zend_object_handlers.c | |
parent | 0cc2600ec64d882df7f44390bfd5411750f86947 (diff) | |
parent | d67c05bb899f4db42dd568376112b9144de2b5f1 (diff) | |
download | php-git-ef0eed7f5ff34236b39d9c5914e1627ef30c7cb7.tar.gz |
Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
Diffstat (limited to 'Zend/zend_object_handlers.c')
-rw-r--r-- | Zend/zend_object_handlers.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 093951eeca..a7b761fa38 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -754,9 +754,6 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, int type /* we don't have access controls - will just add it */ new_zval = &EG(uninitialized_zval); - if(UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) { - zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name, Z_STRVAL_P(member)); - } Z_ADDREF_P(new_zval); if (EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) && property_info->offset >= 0) { @@ -776,6 +773,12 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, int type } zend_hash_quick_update(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, &new_zval, sizeof(zval *), (void **) &retval); } + + /* Notice is thrown after creation of the property, to avoid EG(std_property_info) + * being overwritten in an error handler. */ + if (UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) { + zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name, Z_STRVAL_P(member)); + } } else { /* we do have getter - fail and let it try again with usual get/set */ retval = NULL; |