From 2c5463fe99df8868e53817af834f1ecec9875515 Mon Sep 17 00:00:00 2001 From: ko1 Date: Fri, 17 Aug 2007 13:48:39 +0000 Subject: * 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 --- compile.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'compile.c') diff --git a/compile.c b/compile.c index e6db61718a..e1ab85b180 100644 --- a/compile.c +++ b/compile.c @@ -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:{ -- cgit v1.2.3