summaryrefslogtreecommitdiff
path: root/Zend/zend_vm_execute.h
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_vm_execute.h
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_vm_execute.h')
-rw-r--r--Zend/zend_vm_execute.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 677cabe2a9..7774e9654f 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -742,6 +742,37 @@ static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZEND_VM_NEXT_OPCODE();
}
+static int ZEND_FASTCALL ZEND_RECV_VARIADIC_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+ USE_OPLINE
+ zend_uint arg_num = opline->op1.num;
+ zend_uint arg_count = zend_vm_stack_get_args_count(TSRMLS_C);
+ zval **var_ptr, *params;
+
+ SAVE_OPLINE();
+
+ var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
+ Z_DELREF_PP(var_ptr);
+ MAKE_STD_ZVAL(params);
+ *var_ptr = params;
+
+ if (arg_num <= arg_count) {
+ array_init_size(params, arg_count - arg_num + 1);
+ } else {
+ array_init(params);
+ }
+
+ for (; arg_num <= arg_count; ++arg_num) {
+ zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
+ zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC);
+ zend_hash_next_index_insert(Z_ARRVAL_P(params), param, sizeof(zval *), NULL);
+ Z_ADDREF_PP(param);
+ }
+
+ CHECK_EXCEPTION();
+ ZEND_VM_NEXT_OPCODE();
+}
+
static int ZEND_FASTCALL ZEND_NEW_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -44895,6 +44926,31 @@ void zend_init_opcodes_handlers(void)
ZEND_FAST_RET_SPEC_HANDLER,
ZEND_FAST_RET_SPEC_HANDLER,
ZEND_FAST_RET_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
+ ZEND_RECV_VARIADIC_SPEC_HANDLER,
ZEND_NULL_HANDLER
};
zend_opcode_handlers = (opcode_handler_t*)labels;