Commit:    0ceea8a2e833a3bd42f30b9f5b952b807f96cecc
Author:    Nikita Popov <ni...@php.net>         Thu, 26 Sep 2013 19:43:32 +0200
Parents:   0d7a6388663b76ebed6585ac92dfca5ef65fa7af
Branches:  master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=0ceea8a2e833a3bd42f30b9f5b952b807f96cecc

Log:
Don't track parameter number in separate znode

We already track it in the op array already.

Changed paths:
  M  Zend/zend_compile.c
  M  Zend/zend_compile.h
  M  Zend/zend_language_parser.y


Diff:
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 90ff262..25a604c 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1822,7 +1822,7 @@ void zend_do_end_function_declaration(const znode 
*function_token TSRMLS_DC) /*
 }
 /* }}} */
 
-void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, 
const znode *initialization, znode *class_type, zend_uchar pass_by_reference, 
zend_bool is_variadic TSRMLS_DC) /* {{{ */
+void zend_do_receive_param(zend_uchar op, znode *varname, const znode 
*initialization, znode *class_type, zend_uchar pass_by_reference, zend_bool 
is_variadic TSRMLS_DC) /* {{{ */
 {
        zend_op *opline;
        zend_arg_info *cur_arg_info;
@@ -1863,7 +1863,8 @@ void zend_do_receive_arg(zend_uchar op, znode *varname, 
const znode *offset, con
        CG(active_op_array)->num_args++;
        opline->opcode = op;
        SET_NODE(opline->result, &var);
-       SET_NODE(opline->op1, offset);
+       opline->op1_type = IS_UNUSED;
+       opline->op1.num = CG(active_op_array)->num_args;
        if (op == ZEND_RECV_INIT) {
                SET_NODE(opline->op2, initialization);
        } else {
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 0e07029..f9520c9 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -501,7 +501,7 @@ void zend_do_add_variable(znode *result, const znode *op1, 
const znode *op2 TSRM
 int zend_do_verify_access_types(const znode *current_access_type, const znode 
*new_modifier);
 void zend_do_begin_function_declaration(znode *function_token, znode 
*function_name, int is_method, int return_reference, znode *fn_flags_znode 
TSRMLS_DC);
 void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC);
-void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, 
const znode *initialization, znode *class_type, zend_bool pass_by_reference, 
zend_bool is_variadic TSRMLS_DC);
+void zend_do_receive_param(zend_uchar op, znode *varname, const znode 
*initialization, znode *class_type, zend_bool pass_by_reference, zend_bool 
is_variadic TSRMLS_DC);
 int zend_do_begin_function_call(znode *function_name, zend_bool 
check_namespace TSRMLS_DC);
 void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC);
 void zend_do_clone(znode *result, const znode *expr TSRMLS_DC);
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index 4523783..d461499 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -528,14 +528,15 @@ parameter_list:
 
 
 non_empty_parameter_list:
+               parameter
+       |       non_empty_parameter_list ',' parameter
+;
+
+parameter:
                optional_class_type is_reference is_variadic T_VARIABLE
-                       { $$.op_type = IS_UNUSED; $$.u.op.num=1; 
zend_do_receive_arg(ZEND_RECV, &$4, &$$, NULL, &$1, $2.op_type, $3.op_type 
TSRMLS_CC); }
+                       { zend_do_receive_param(ZEND_RECV, &$4, NULL, &$1, 
$2.op_type, $3.op_type TSRMLS_CC); }
        |       optional_class_type is_reference is_variadic T_VARIABLE '=' 
static_scalar
-                       { $$.op_type = IS_UNUSED; $$.u.op.num=1; 
zend_do_receive_arg(ZEND_RECV_INIT, &$4, &$$, &$6, &$1, $2.op_type, $3.op_type 
TSRMLS_CC); }
-       |       non_empty_parameter_list ',' optional_class_type is_reference 
is_variadic T_VARIABLE
-                       { $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV, 
&$6, &$$, NULL, &$3, $4.op_type, $5.op_type TSRMLS_CC); }
-       |       non_empty_parameter_list ',' optional_class_type is_reference 
is_variadic T_VARIABLE '=' static_scalar
-                       { $$=$1; $$.u.op.num++; 
zend_do_receive_arg(ZEND_RECV_INIT, &$6, &$$, &$8, &$3, $4.op_type, $5.op_type 
TSRMLS_CC); }
+                       { zend_do_receive_param(ZEND_RECV_INIT, &$4, &$6, &$1, 
$2.op_type, $3.op_type TSRMLS_CC); }
 ;


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to