summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-03 18:58:42 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-03 18:58:42 +0000
commit1d8ce92a37df9e8c1f9a68de82fee8c9b3e66af6 (patch)
tree418f10dffea9bb548ef3eeb2a6eb039f9112fc4b /compile.c
parentd82f3e7d5cf98f484cd1b3ed397e45d2fd7cf806 (diff)
* compile.c (iseq_compile_each): support v[&b]= type method call.
[ruby-dev:31094] * bootstraptest/test_method.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index a30a98efdb..02f2214940 100644
--- a/compile.c
+++ b/compile.c
@@ -4285,8 +4285,16 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSN(ret, nd_line(node), putnil);
ADD_SEQ(ret, recv);
ADD_SEQ(ret, args);
+
+ if (flag & VM_CALL_ARGS_BLOCKARG_BIT) {
+ ADD_INSN1(ret, nd_line(node), topn, INT2FIX(1));
+ ADD_INSN1(ret, nd_line(node), setn, INT2FIX(FIX2INT(argc) + 3));
+ ADD_INSN (ret, nd_line(node), pop);
+ }
+ else {
ADD_INSN1(ret, nd_line(node), setn, INT2FIX(FIX2INT(argc) + 1));
}
+ }
else {
ADD_SEQ(ret, recv);
ADD_SEQ(ret, args);