com php-src: Merge branch 'PHP-5.6': Zend/zend_object_handl ers.c

From: Date: Fri, 03 Oct 2014 19:30:06 +0000
Subject: com php-src: Merge branch 'PHP-5.6': Zend/zend_object_handl ers.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-82077@lists.php.net to get a copy of this message
Commit: 443374675e6ccbc26c2a8243f3311f0db69bf3cb Author: Nikita Popov <nikic@php.net> Fri, 3 Oct 2014 21:30:06 +0200 Parents: e7623f470f3c43396db4adcceeb63bd7029bc5ff 8617f2fa8d6feeda4c87e1c0f8697101f03429f2 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=443374675e6ccbc26c2a8243f3311f0db69bf3cb Log: Merge branch 'PHP-5.6' Conflicts: Zend/zend_object_handlers.c Changed paths: MM Zend/zend_object_handlers.c Diff: diff --cc Zend/zend_object_handlers.c index c2377e7,a5577d0..5ee9847 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@@ -796,48 -767,57 +796,50 @@@ static zval *zend_std_get_property_ptr_ fprintf(stderr, "Ptr object #%d property: %s\n", Z_OBJ_HANDLE_P(object), Z_STRVAL_P(member)); #endif - property_info = zend_get_property_info_quick(zobj->ce, member, (zobj->ce->__get != NULL), key TSRMLS_CC); - - if (UNEXPECTED(!property_info) || - ((EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) && - property_info->offset >= 0) ? - (zobj->properties ? - ((retval = (zval**)zobj->properties_table[property_info->offset]) == NULL) : - (*(retval = &zobj->properties_table[property_info->offset]) == NULL)) : - (UNEXPECTED(!zobj->properties) || - UNEXPECTED(zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &retval) == FAILURE)))) { - zval *new_zval; - zend_guard *guard; - - if (!zobj->ce->__get || - zend_get_property_guard(zobj, property_info, member, &guard) != SUCCESS || - (property_info && guard->in_get)) { - /* we don't have access controls - will just add it */ - new_zval = &EG(uninitialized_zval); - - Z_ADDREF_P(new_zval); - if (EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) && - property_info->offset >= 0) { - if (!zobj->properties) { - zobj->properties_table[property_info->offset] = new_zval; - retval = &zobj->properties_table[property_info->offset]; - } else if (zobj->properties_table[property_info->offset]) { - *(zval**)zobj->properties_table[property_info->offset] = new_zval; - retval = (zval**)zobj->properties_table[property_info->offset]; - } else { - zend_hash_quick_update(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, &new_zval, sizeof(zval *), (void**)&zobj->properties_table[property_info->offset]); - retval = (zval**)zobj->properties_table[property_info->offset]; - } - } else { - if (!zobj->properties) { - rebuild_object_properties(zobj); - } - zend_hash_quick_update(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, &new_zval, sizeof(zval *), (void **) &retval); - } + property_info = zend_get_property_info_quick(zobj->ce, Z_STR_P(member), (zobj->ce->__get != NULL), cache_slot TSRMLS_CC); - /* 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)); + if (EXPECTED(property_info != NULL)) { + if (EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) && + property_info->offset >= 0) { + retval = &zobj->properties_table[property_info->offset]; + if (Z_TYPE_P(retval) != IS_UNDEF) { + goto exit; } + } else if (UNEXPECTED(zobj->properties != NULL)) { + retval = zend_hash_find(zobj->properties, property_info->name); + if (retval) goto exit; + } + } + + if (!zobj->ce->__get || + (guard = zend_get_property_guard(zobj, property_info, member)) == NULL || + (property_info && ((*guard) & IN_GET))) { + - /* we don't have access controls - will just add it */ - if(UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) { - zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name->val, Z_STRVAL_P(member)); - } + ZVAL_NULL(&tmp); + if (EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) && + property_info->offset >= 0) { + retval = &zobj->properties_table[property_info->offset]; + ZVAL_NULL(retval); } else { - /* we do have getter - fail and let it try again with usual get/set */ - retval = NULL; + if (!zobj->properties) { + rebuild_object_properties(zobj); + } + retval = zend_hash_update(zobj->properties, property_info->name, &tmp); + } ++ ++ /* 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->val, Z_STRVAL_P(member)); + } + } else { + /* we do have getter - fail and let it try again with usual get/set */ + retval = NULL; } - if (UNEXPECTED(member == &tmp_member)) { - zval_dtor(member); + +exit: + if (UNEXPECTED(Z_TYPE(tmp_member) != IS_UNDEF)) { + zval_dtor(&tmp_member); } return retval; }

« previous php.cvs (#82077) next »