com php-src: Fixed ext/spl/tests/iterator_035.phpt: Zend/zend_execute.c ext/spl/spl_array.c
| From: | Dmitry Stogov | Date: | Wed, 09 Apr 2014 19:49:58 +0000 |
| Subject: | com php-src: Fixed ext/spl/tests/iterator_035.phpt: Zend/zend_execute.c ext/spl/spl_array.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77454@lists.php.net to get a copy of this message | ||
Commit: 29f068779f14cee4aac65f8c04f1a57a44013e34
Author: Dmitry Stogov <dmitry@zend.com> Wed, 9 Apr 2014 23:49:58 +0400
Parents: a938b2460723f609a6524e8e91058985fdc2a897
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=29f068779f14cee4aac65f8c04f1a57a44013e34
Log:
Fixed ext/spl/tests/iterator_035.phpt
Changed paths:
M Zend/zend_execute.c
M ext/spl/spl_array.c
Diff:
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index f303860..822ec90 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1160,7 +1160,9 @@ convert_to_array:
//??? }
retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result TSRMLS_CC);
- if (retval && Z_TYPE_P(retval) != IS_UNDEF) {
+ if (UNEXPECTED(retval == &EG(uninitialized_zval))) {
+ ZVAL_NULL(result);
+ } else if (retval && Z_TYPE_P(retval) != IS_UNDEF) {
if (!Z_ISREF_P(retval)) {
if (Z_REFCOUNTED_P(retval) &&
Z_REFCOUNT_P(retval) > 1) {
@@ -1182,7 +1184,7 @@ convert_to_array:
//??? PZVAL_LOCK(retval);
//??? ZVAL_COPY(result, retval);
if (result != retval) {
- if (is_ref && retval != &EG(uninitialized_zval)) {
+ if (is_ref) {
SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);
ZVAL_COPY(result, retval);
} else {
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 3bd4b3d..afd3fc6 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -428,7 +428,9 @@ static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval
* by separating (if necessary) and returning as an is_ref=1 zval (even if refcount == 1)
*/
- if ((type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET) && !Z_ISREF_P(ret)) {
+ if ((type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET) &&
+ !Z_ISREF_P(ret) &&
+ EXPECTED(ret != &EG(uninitialized_zval))) {
ZVAL_NEW_REF(ret, ret);
}