mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 17:14:01 +02:00
merge revision(s) 56469: [Backport #12860]
* compile.c (setup_args): duplicate splatting array if more arguments present to obey left-to-right execution order. [ruby-core:77701] [Bug# 12860] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@57210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
16d03ff2a4
commit
a078bbcc17
4 changed files with 17 additions and 3 deletions
|
|
@ -3267,7 +3267,7 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, unsigned int *flag, r
|
|||
switch (nd_type(argn)) {
|
||||
case NODE_SPLAT: {
|
||||
COMPILE(args, "args (splat)", argn->nd_head);
|
||||
ADD_INSN1(args, nd_line(argn), splatarray, Qfalse);
|
||||
ADD_INSN1(args, nd_line(argn), splatarray, nsplat ? Qtrue : Qfalse);
|
||||
argc = INT2FIX(1);
|
||||
nsplat++;
|
||||
*flag |= VM_CALL_ARGS_SPLAT;
|
||||
|
|
@ -3281,7 +3281,7 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, unsigned int *flag, r
|
|||
INIT_ANCHOR(tmp);
|
||||
COMPILE(tmp, "args (cat: splat)", argn->nd_body);
|
||||
if (nd_type(argn) == NODE_ARGSCAT) {
|
||||
ADD_INSN1(tmp, nd_line(argn), splatarray, Qfalse);
|
||||
ADD_INSN1(tmp, nd_line(argn), splatarray, nsplat ? Qtrue : Qfalse);
|
||||
}
|
||||
else {
|
||||
ADD_INSN1(tmp, nd_line(argn), newarray, INT2FIX(1));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue