summaryrefslogtreecommitdiff
path: root/Zend/zend_builtin_functions.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2015-09-22 13:58:42 +0800
committerXinchen Hui <laruence@gmail.com>2015-09-22 13:58:42 +0800
commit0f3ab1c2d03c27ebee0156cd8bfbb1c5721d9f32 (patch)
tree1e9e1297c0b1e4d0d5a03fca0b760fc4882b32bd /Zend/zend_builtin_functions.c
parentb8ea991821753898ba30fa170b25eadd3fc703b2 (diff)
downloadphp-git-0f3ab1c2d03c27ebee0156cd8bfbb1c5721d9f32.tar.gz
Fixed #70547 similar bug in func_get_args
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r--Zend/zend_builtin_functions.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index b0e4f6ab02..3bdc94d7d7 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -502,9 +502,13 @@ ZEND_FUNCTION(func_get_args)
if (arg_count > first_extra_arg) {
while (i < first_extra_arg) {
q = p;
- ZVAL_DEREF(q);
- if (Z_OPT_REFCOUNTED_P(q)) Z_ADDREF_P(q);
- ZEND_HASH_FILL_ADD(q);
+ if (EXPECTED(Z_TYPE_INFO_P(q) != IS_UNDEF)) {
+ ZVAL_DEREF(q);
+ if (Z_OPT_REFCOUNTED_P(q)) {
+ Z_ADDREF_P(q);
+ }
+ ZEND_HASH_FILL_ADD(q);
+ }
p++;
i++;
}
@@ -512,9 +516,13 @@ ZEND_FUNCTION(func_get_args)
}
while (i < arg_count) {
q = p;
- ZVAL_DEREF(q);
- if (Z_OPT_REFCOUNTED_P(q)) Z_ADDREF_P(q);
- ZEND_HASH_FILL_ADD(q);
+ if (EXPECTED(Z_TYPE_INFO_P(q) != IS_UNDEF)) {
+ ZVAL_DEREF(q);
+ if (Z_OPT_REFCOUNTED_P(q)) {
+ Z_ADDREF_P(q);
+ }
+ ZEND_HASH_FILL_ADD(q);
+ }
p++;
i++;
}
@@ -2233,7 +2241,7 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
if (ZEND_CALL_NUM_ARGS(call) > first_extra_arg) {
while (i < first_extra_arg) {
- if (Z_TYPE_INFO_P(p) != IS_UNDEF) {
+ if (EXPECTED(Z_TYPE_INFO_P(p) != IS_UNDEF)) {
if (Z_OPT_REFCOUNTED_P(p)) {
Z_ADDREF_P(p);
}
@@ -2247,7 +2255,7 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
}
while (i < num_args) {
- if (Z_TYPE_INFO_P(p) != IS_UNDEF) {
+ if (EXPECTED(Z_TYPE_INFO_P(p) != IS_UNDEF)) {
if (Z_OPT_REFCOUNTED_P(p)) {
Z_ADDREF_P(p);
}