summaryrefslogtreecommitdiff
path: root/Zend/zend_vm_def.h
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2014-02-26 16:25:10 +0100
committerNikita Popov <nikic@php.net>2014-02-26 16:40:25 +0100
commit95c73f99d358f42960cdd536c589244abf35174e (patch)
treefda90a7ed2cf26e145de287eef66a8891a488e4e /Zend/zend_vm_def.h
parentd3b484df8268f7ab31c4ac39734d4b68ce2e6159 (diff)
downloadphp-git-95c73f99d358f42960cdd536c589244abf35174e.tar.gz
Don't add num_additional_args in SEND opcodes
Now that trailing positional args are disallowed, num_additional_args will always be zero in SEND opcodes (and FUNC_ARG fetches).
Diffstat (limited to 'Zend/zend_vm_def.h')
-rw-r--r--Zend/zend_vm_def.h17
1 files changed, 6 insertions, 11 deletions
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 713d6fadee..ed353edbac 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -3063,9 +3063,8 @@ ZEND_VM_HANDLER(65, ZEND_SEND_VAL, CONST|TMP, ANY)
SAVE_OPLINE();
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
- int arg_num = opline->op2.num + EX(call)->num_additional_args;
- if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
- zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", arg_num);
+ if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
+ zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.num);
}
}
@@ -3126,7 +3125,6 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
USE_OPLINE
zend_free_op free_op1;
zval *varptr;
- int arg_num;
SAVE_OPLINE();
if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */
@@ -3134,8 +3132,7 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
}
} else {
- arg_num = opline->op2.num + EX(call)->num_additional_args;
- if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
+ if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
}
}
@@ -3155,7 +3152,7 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
- !ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
+ !ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
zend_error(E_STRICT, "Only variables should be passed by reference");
}
ALLOC_ZVAL(valptr);
@@ -3193,8 +3190,7 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {
- int arg_num = opline->op2.num + EX(call)->num_additional_args;
- if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
+ if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
}
}
@@ -3214,8 +3210,7 @@ ZEND_VM_HANDLER(66, ZEND_SEND_VAR, VAR|CV, ANY)
USE_OPLINE
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
- int arg_num = opline->op2.num + EX(call)->num_additional_args;
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
+ if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
ZEND_VM_DISPATCH_TO_HANDLER(ZEND_SEND_REF);
}
}