summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.c
diff options
context:
space:
mode:
authorChristopher Jones <sixd@php.net>2013-09-26 09:57:36 -0700
committerChristopher Jones <sixd@php.net>2013-09-26 09:57:36 -0700
commita3b0fa0d04cad5712f64e08463d0026f9890a37c (patch)
tree1317a8a47c0e4bd1193c8fbf705d91ae75140f78 /Zend/zend_execute.c
parentc175617b800536c08b593cf080f8120623cc009e (diff)
parent0d7a6388663b76ebed6585ac92dfca5ef65fa7af (diff)
downloadphp-git-a3b0fa0d04cad5712f64e08463d0026f9890a37c.tar.gz
Merge branch 'master' of https://git.php.net/repository/php-src
# By Adam Harvey (2) and others # Via Adam Harvey (2) and others * 'master' of https://git.php.net/repository/php-src: Implement variadic function syntax Added function opcache_compile_file() to load PHP scripts into cache without execution. Fixed issue #135 (segfault in interned strings if initial memory is too low) Fix typo: HTTP_ROW_POST_DATA → HTTP_RAW_POST_DATA. Make message and format arguments const char * to avoid build warning about invalid cast. Copy dba_*() keys before converting to string.
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r--Zend/zend_execute.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index c79a55169c..9f78218d3d 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -616,12 +616,17 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
char *need_msg;
zend_class_entry *ce;
- if (!zf->common.arg_info
- || arg_num>zf->common.num_args) {
+ if (!zf->common.arg_info) {
return 1;
}
- cur_arg_info = &zf->common.arg_info[arg_num-1];
+ if (arg_num <= zf->common.num_args) {
+ cur_arg_info = &zf->common.arg_info[arg_num-1];
+ } else if (zf->common.fn_flags & ZEND_ACC_VARIADIC) {
+ cur_arg_info = &zf->common.arg_info[zf->common.num_args-1];
+ } else {
+ return 1;
+ }
if (cur_arg_info->class_name) {
const char *class_name;