diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-17 13:48:39 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-17 13:48:39 +0000 |
commit | 2c5463fe99df8868e53817af834f1ecec9875515 (patch) | |
tree | 1b0d860d5bf0cd05c6fb19c2674d5d2024b6313c | |
parent | ad272173cdeb8233757088d765ed16444dc7d17a (diff) | |
download | ruby-2c5463fe99df8868e53817af834f1ecec9875515.tar.gz |
* compile.c (iseq_compile_each): massign should return rvalue(s).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | compile.c | 23 |
2 files changed, 18 insertions, 9 deletions
@@ -1,3 +1,7 @@ +Fri Aug 17 22:43:11 2007 Koichi Sasada <ko1@atdot.net> + + * compile.c (iseq_compile_each): massign should return rvalue(s). + Fri Aug 17 22:10:19 2007 Koichi Sasada <ko1@atdot.net> * test/ruby/test_basicinstructions.rb: fix old tests. @@ -3200,15 +3200,20 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) } case NODE_MASGN:{ - compile_massign(iseq, ret, - node->nd_value, /* rhsn */ - node->nd_args, /* splat */ - node->nd_head, /* lhsn */ - 0); - if (!poped) { - ADD_INSN1(ret, nd_line(node), putobject, Qtrue); - } - break; + if (poped) { + compile_massign(iseq, ret, + node->nd_value, /* rhsn */ + node->nd_args, /* splat */ + node->nd_head, /* lhsn */ + 0); + } + else { + COMPILE(ret, "masgn/value", node->nd_value); + ADD_INSN(ret, nd_line(node), dup); + compile_massign(iseq, ret, 0, + node->nd_args, node->nd_head, 0); + } + break; } case NODE_LASGN:{ |