ruby-changes:16880
From: mame <ko1@a...>
Date: Thu, 5 Aug 2010 21:32:18 +0900 (JST)
Subject: [ruby-changes:16880] Ruby:r28876 (trunk): * compile.c (NODE_ARGSCAT, NODE_ARGSPUSH): revert r28870 and r28873
mame 2010-08-05 21:31:55 +0900 (Thu, 05 Aug 2010) New Revision: 28876 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28876 Log: * compile.c (NODE_ARGSCAT, NODE_ARGSPUSH): revert r28870 and r28873 which involuntarily changed semantics of type conversion. I'll re-commit a correct patch. Modified files: trunk/ChangeLog trunk/compile.c trunk/test/ruby/test_primitive.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 28875) +++ ChangeLog (revision 28876) @@ -1,10 +1,3 @@ -Thu Aug 5 20:30:39 2010 Nobuyoshi Nakada <nobu@r...> - - * compile.c (iseq_compile_each): to_a method should be called. - [Bug #3658] - - * compile.c (iseq_compile_each): ditto for ARGSPUSH. - Thu Aug 5 20:13:49 2010 Nobuyoshi Nakada <nobu@r...> * README.EXT, README.EXT.ja (String functions): mention @@ -15,11 +8,6 @@ * string.c (rb_str_set_len): bail out when buffer overflowed probably. -Thu Aug 5 19:51:21 2010 Nobuyoshi Nakada <nobu@r...> - - * compile.c (iseq_compile_each): drop unused ARGSCAT results. - fix [ruby-dev:41933], [Bug #3658] - Thu Aug 5 18:36:11 2010 Nobuyoshi Nakada <nobu@r...> * complex.c (nucomp_marshal_load): should check the argument. Index: compile.c =================================================================== --- compile.c (revision 28875) +++ compile.c (revision 28876) @@ -4521,24 +4521,14 @@ break; } case NODE_ARGSCAT:{ - COMPILE_(ret, "argscat head", node->nd_head, poped); + COMPILE(ret, "argscat head", node->nd_head); COMPILE(ret, "argscat body", node->nd_body); - if (poped) { - ADD_INSN1(ret, nd_line(node), splatarray, Qfalse); - ADD_INSN(ret, nd_line(node), pop); - break; - } ADD_INSN(ret, nd_line(node), concatarray); break; } case NODE_ARGSPUSH:{ - COMPILE_(ret, "arsgpush head", node->nd_head, poped); + COMPILE(ret, "arsgpush head", node->nd_head); COMPILE(ret, "argspush body", node->nd_body); - if (poped) { - ADD_INSN1(ret, nd_line(node), splatarray, Qfalse); - ADD_INSN(ret, nd_line(node), pop); - break; - } ADD_INSN1(ret, nd_line(node), newarray, INT2FIX(1)); ADD_INSN(ret, nd_line(node), concatarray); break; Index: test/ruby/test_primitive.rb =================================================================== --- test/ruby/test_primitive.rb (revision 28875) +++ test/ruby/test_primitive.rb (revision 28876) @@ -273,7 +273,6 @@ assert_equal 'abcd', $& assert_equal 'xyz', $` assert_equal 'efgabcdefg', $' - # ' assert_equal 'c', $+ /(?!)/ =~ 'xyzabcdefgabcdefg' @@ -401,24 +400,4 @@ #assert_equal [0,1,2,3,4], [0, *a, 4] end - def test_concatarray_ruby_dev_41933 - bug3658 = '[ruby-dev:41933]' - [0, *x=1] - assert_equal(1, x, bug3658) - [0, *x=1, 2] - assert_equal(1, x, bug3658) - class << (x = Object.new) - attr_accessor :to_a_called - def to_a - @to_a_called = true - [self] - end - end - x.to_a_called = false - [0, *x] - assert(x.to_a_called, bug3658) - x.to_a_called = false - [0, *x, 2] - assert(x.to_a_called, bug3658) - end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/