diff options
| author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-07-05 17:11:45 +0000 |
|---|---|---|
| committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-07-05 17:11:45 +0000 |
| commit | 4545cd983e8ca746576f237c302ed98cc320df73 (patch) | |
| tree | 2b42887f15e4f43afc9ee9c6e40f6b3606b9a14c /insns.def | |
| parent | 81a5be6809e5895584951def32d9a9508616daf8 (diff) | |
| download | ruby-4545cd983e8ca746576f237c302ed98cc320df73.tar.gz ruby-4545cd983e8ca746576f237c302ed98cc320df73.tar.xz ruby-4545cd983e8ca746576f237c302ed98cc320df73.zip | |
* insns.def: fix to invoke nil.to_splat on NODE_ARGSCAT.
[ruby-dev:31138].
* bootstraptest/test_literal.rb: add tests for above.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'insns.def')
| -rw-r--r-- | insns.def | 26 |
1 files changed, 10 insertions, 16 deletions
@@ -555,27 +555,21 @@ concatarray (VALUE ary) { VALUE ary2 = ary2st; + VALUE tmp1 = rb_check_convert_type(ary1, T_ARRAY, "Array", "to_splat"); + VALUE tmp2 = rb_check_convert_type(ary2, T_ARRAY, "Array", "to_splat"); - if (ary2 == Qnil) { - ary = ary1; + if (NIL_P(tmp1)) { + tmp1 = rb_ary_new3(1, ary1); } - else { - VALUE tmp1 = rb_check_convert_type(ary1, T_ARRAY, "Array", "to_splat"); - VALUE tmp2 = rb_check_convert_type(ary2, T_ARRAY, "Array", "to_splat"); - if (NIL_P(tmp1)) { - tmp1 = rb_ary_new3(1, ary1); - } - - if (NIL_P(tmp2)) { - tmp2 = rb_ary_new3(1, ary2); - } + if (NIL_P(tmp2)) { + tmp2 = rb_ary_new3(1, ary2); + } - if (tmp1 == ary1) { - tmp1 = rb_ary_dup(ary1); - } - ary = rb_ary_concat(tmp1, tmp2); + if (tmp1 == ary1) { + tmp1 = rb_ary_dup(ary1); } + ary = rb_ary_concat(tmp1, tmp2); } /** |
