ruby-changes:10236
From: nobu <ko1@a...>
Date: Mon, 26 Jan 2009 16:01:01 +0900 (JST)
Subject: [ruby-changes:10236] Ruby:r21780 (trunk, ruby_1_8): * array.c (rb_ary_aset): fixed arguments evaluation order.
nobu 2009-01-26 16:00:43 +0900 (Mon, 26 Jan 2009) New Revision: 21780 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21780 Log: * array.c (rb_ary_aset): fixed arguments evaluation order. Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/array.c trunk/ChangeLog trunk/array.c Index: array.c =================================================================== --- array.c (revision 21779) +++ array.c (revision 21780) @@ -1270,7 +1270,9 @@ long offset, beg, len; if (argc == 3) { - rb_ary_splice(ary, NUM2LONG(argv[0]), NUM2LONG(argv[1]), argv[2]); + beg = NUM2LONG(argv[0]); + len = NUM2LONG(argv[1]); + rb_ary_splice(ary, beg, len, argv[2]); return argv[2]; } if (argc != 2) { Index: ChangeLog =================================================================== --- ChangeLog (revision 21779) +++ ChangeLog (revision 21780) @@ -1,3 +1,7 @@ +Mon Jan 26 16:00:40 2009 Nobuyoshi Nakada <nobu@r...> + + * array.c (rb_ary_aset): fixed arguments evaluation order. + Mon Jan 26 15:49:42 2009 Nobuyoshi Nakada <nobu@r...> * lib/pathname.rb (chop_basename, prepend_prefix): use o option. Index: ruby_1_8/array.c =================================================================== --- ruby_1_8/array.c (revision 21779) +++ ruby_1_8/array.c (revision 21780) @@ -1187,7 +1187,9 @@ if (SYMBOL_P(argv[1])) { rb_raise(rb_eTypeError, "Symbol as subarray length"); } - rb_ary_splice(ary, NUM2LONG(argv[0]), NUM2LONG(argv[1]), argv[2]); + beg = NUM2LONG(argv[0]); + len = NUM2LONG(argv[1]); + rb_ary_splice(ary, beg, len, argv[2]); return argv[2]; } if (argc != 2) { Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 21779) +++ ruby_1_8/ChangeLog (revision 21780) @@ -1,3 +1,7 @@ +Mon Jan 26 16:00:40 2009 Nobuyoshi Nakada <nobu@r...> + + * array.c (rb_ary_aset): fixed arguments evaluation order. + Mon Jan 26 15:49:42 2009 Nobuyoshi Nakada <nobu@r...> * lib/pathname.rb (chop_basename, prepend_prefix): use o option. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/