{
zval *p, *q;
uint32_t arg_count, first_extra_arg;
- uint32_t i, n;
+ uint32_t i;
zend_execute_data *ex = EX(prev_execute_data);
if (ZEND_CALL_INFO(ex) & ZEND_CALL_CODE) {
zend_hash_real_init(Z_ARRVAL_P(return_value), 1);
ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(return_value)) {
i = 0;
- n = 0;
p = ZEND_CALL_ARG(ex, 1);
if (arg_count > first_extra_arg) {
while (i < first_extra_arg) {
if (Z_OPT_REFCOUNTED_P(q)) {
Z_ADDREF_P(q);
}
- n++;
+ } else {
+ q = &EG(uninitialized_zval);
}
ZEND_HASH_FILL_ADD(q);
p++;
if (Z_OPT_REFCOUNTED_P(q)) {
Z_ADDREF_P(q);
}
- n++;
+ } else {
+ q = &EG(uninitialized_zval);
}
ZEND_HASH_FILL_ADD(q);
p++;
i++;
}
} ZEND_HASH_FILL_END();
- Z_ARRVAL_P(return_value)->nNumOfElements = n;
+ Z_ARRVAL_P(return_value)->nNumOfElements = arg_count;
}
}
/* }}} */
array_init_size(arg_array, num_args);
if (num_args) {
uint32_t i = 0;
- uint32_t n = 0;
zval *p = ZEND_CALL_ARG(call, 1);
zend_hash_real_init(Z_ARRVAL_P(arg_array), 1);
if (Z_OPT_REFCOUNTED_P(arg)) {
Z_ADDREF_P(arg);
}
- n++;
ZEND_HASH_FILL_ADD(arg);
} else {
- zval tmp;
- ZVAL_UNDEF(&tmp);
- ZEND_HASH_FILL_ADD(&tmp);
+ ZEND_HASH_FILL_ADD(&EG(uninitialized_zval));
}
i++;
}
if (Z_OPT_REFCOUNTED_P(p)) {
Z_ADDREF_P(p);
}
- n++;
+ ZEND_HASH_FILL_ADD(p);
+ } else {
+ ZEND_HASH_FILL_ADD(&EG(uninitialized_zval));
}
- ZEND_HASH_FILL_ADD(p);
p++;
i++;
}
if (Z_OPT_REFCOUNTED_P(p)) {
Z_ADDREF_P(p);
}
- n++;
+ ZEND_HASH_FILL_ADD(p);
+ } else {
+ ZEND_HASH_FILL_ADD(&EG(uninitialized_zval));
}
- ZEND_HASH_FILL_ADD(p);
p++;
i++;
}
} ZEND_HASH_FILL_END();
- Z_ARRVAL_P(arg_array)->nNumOfElements = n;
+ Z_ARRVAL_P(arg_array)->nNumOfElements = num_args;
}
}
/* }}} */