diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-07-05 18:16:54 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-07-05 18:16:54 +0000 |
commit | 976bfae03be67236543367aef7b8a22df02cd37b (patch) | |
tree | 8942ae65bee913d9329292fc0408b8635d0fc3fc /compile.c | |
parent | b9171a73c4f0d212b723e0160859ab69b89b3339 (diff) | |
download | ruby-976bfae03be67236543367aef7b8a22df02cd37b.tar.gz |
* insns.def: remove unused code.
* compile.c (compile_massign): fix to invoke to_splat on
splat rhs (example: *a = *nil). [ruby-dev:31136]
* bootstraptest/test_massign.rb: add tests for above.
* compile.c (iseq_compile_each): disable excess optimization.
[ruby-dev:31126]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -2044,21 +2044,18 @@ compile_massign(rb_iseq_t *iseq, LINK_ANCHOR *ret, break; case NODE_SPLAT: - COMPILE(ret, "rhs to ary (splat)", rhsn->nd_head); - ADD_INSN2(ret, nd_line(rhsn), expandarray, INT2FIX(llen), - INT2FIX(lhs_splat)); + COMPILE(ret, "rhs to ary (splat)", rhsn); + ADD_INSN2(ret, nd_line(rhsn), expandarray, INT2FIX(llen), INT2FIX(lhs_splat)); break; case NODE_ARGSCAT: COMPILE(ret, "rhs to argscat", rhsn); - ADD_INSN2(ret, nd_line(rhsn), expandarray, - INT2FIX(llen), INT2FIX(lhs_splat)); + ADD_INSN2(ret, nd_line(rhsn), expandarray, INT2FIX(llen), INT2FIX(lhs_splat)); break; + default: COMPILE(ret, "rhs to ary (splat/default)", rhsn); - ADD_INSN2(ret, nd_line(rhsn), expandarray, INT2FIX(llen), - INT2FIX(lhs_splat)); - /* rb_compile_error(ERROR_ARGS "unknown rhs: %s", ruby_node_name(nd_type(rhsn))); */ + ADD_INSN2(ret, nd_line(rhsn), expandarray, INT2FIX(llen), INT2FIX(lhs_splat)); } } else { @@ -3974,9 +3971,11 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) break; } case NODE_SPLAT:{ - COMPILE_(ret, "splat", node->nd_head, poped); - if (!poped) { - ADD_INSN1(ret, nd_line(node), splatarray, Qfalse); + COMPILE(ret, "splat", node->nd_head); + ADD_INSN1(ret, nd_line(node), splatarray, Qfalse); + + if (poped) { + ADD_INSN(ret, nd_line(node), pop); } break; } |