From 675c295722192cf394987cca2e36caddd4d0d038 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Thu, 10 Mar 2016 15:09:51 +0800 Subject: [PATCH] Improve the codes (FETCH_DIM_R/IS is read context, we should not expose IS_REFERENCE) --- Zend/zend_execute.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 17bc64125a..432db9be67 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)) { -- 2.40.0