com php-src: Improve the codes (FETCH_DIM_R/IS is rea d context, we should not expose IS_REFERENCE) : Zend/zend_execute.c
| From: | Xinchen Hui | Date: | Thu, 10 Mar 2016 07:09:51 +0000 |
| Subject: | com php-src: Improve the codes (FETCH_DIM_R/IS is rea d context, we should not expose IS_REFERENCE) : Zend/zend_execute.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91307@lists.php.net to get a copy of this message | ||
Commit: 675c295722192cf394987cca2e36caddd4d0d038
Author: Xinchen Hui <laruence@gmail.com> Thu, 10 Mar 2016 15:09:51 +0800
Parents: 98c625a31cc329aa45c48d9c376c6197e278a3a5
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=675c295722192cf394987cca2e36caddd4d0d038
Log:
Improve the codes (FETCH_DIM_R/IS is read context, we should not expose IS_REFERENCE)
Changed paths:
M Zend/zend_execute.c
Diff:
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 17bc641..432db9b 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1561,8 +1561,7 @@ num_index:
retval = zend_hash_index_add_new(ht, hval, &EG(uninitialized_zval));
break;
}
- }
- if (type == BP_VAR_R) {
+ } else if (type == BP_VAR_R) {
ZVAL_DEREF(retval);
}
} else if (EXPECTED(Z_TYPE_P(dim) == IS_STRING)) {
@@ -1594,9 +1593,10 @@ str_index:
ZVAL_NULL(retval);
break;
}
+ } else if (type == BP_VAR_R) {
+ ZVAL_DEREF(retval);
}
- }
- if (type == BP_VAR_R) {
+ } else if (type == BP_VAR_R) {
ZVAL_DEREF(retval);
}
} else {
@@ -1833,7 +1833,7 @@ try_array:
try_string_offset:
if (UNEXPECTED(Z_TYPE_P(dim) != IS_LONG)) {
- switch(Z_TYPE_P(dim)) {
+ switch (Z_TYPE_P(dim)) {
/* case IS_LONG: */
case IS_STRING:
if (IS_LONG == is_numeric_string(Z_STRVAL_P(dim), Z_STRLEN_P(dim), NULL, NULL, -1)) {