Commit 0c3226db authored by ksss's avatar ksss

OP_ENTER fix variable assignment

parent 12915f95
......@@ -1325,16 +1325,18 @@ RETRY_TRY_BLOCK:
pc += argc - m1 - m2 + 1;
}
else {
int rnum = 0;
if (argv0 != argv) {
regs[len+1] = *blk; /* move block */
value_move(&regs[1], argv, m1+o);
}
if (r) {
regs[m1+o+1] = mrb_ary_new_from_values(mrb, argc-m1-o-m2, argv+m1+o);
rnum = argc-m1-o-m2;
regs[m1+o+1] = mrb_ary_new_from_values(mrb, rnum, argv+m1+o);
}
if (m2) {
if (argc-m2 > m1) {
value_move(&regs[m1+o+r+1], &argv[argc-m2], m2);
value_move(&regs[m1+o+r+1], &argv[m1+o+rnum], m2);
}
}
if (argv0 == argv) {
......
......@@ -512,3 +512,10 @@ assert('BS Block 37') do
end
end
assert('BS Block 38') do
def iter
yield 1,2,3,4,5,6
end
assert_equal [1,2,3,4,5], iter{|a,b,c=:c,d,e| [a,b,c,d,e]}
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment