ruby-changes:8492
From: mame <ko1@a...>
Date: Wed, 29 Oct 2008 23:41:00 +0900 (JST)
Subject: [ruby-changes:8492] Ruby:r20025 (trunk, ruby_1_9_1): * revert the previous wrong commit; sorry.
mame 2008-10-29 23:40:31 +0900 (Wed, 29 Oct 2008) New Revision: 20025 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20025 Log: * revert the previous wrong commit; sorry. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/array.c trunk/ChangeLog trunk/array.c Index: array.c =================================================================== --- array.c (revision 20024) +++ array.c (revision 20025) @@ -1751,18 +1751,14 @@ ruby_qsort(RARRAY_PTR(tmp), RARRAY_LEN(tmp), sizeof(VALUE), rb_block_given_p()?sort_1:sort_2, &data); - if (ARY_EMBED_P(tmp)) { + if (ARY_EMBED_P(ary) || ARY_EMBED_P(tmp)) { assert(ARY_EMBED_P(tmp)); - if (ARY_SHARED_P(ary)) { /* ary might be destructively operated in the given block */ - rb_ary_unshared(ary); - FL_SET_EMBED(ary); - } MEMCPY(RARRAY_PTR(ary), ARY_EMBED_PTR(tmp), VALUE, ARY_EMBED_LEN(tmp)); ARY_SET_LEN(ary, ARY_EMBED_LEN(tmp)); } else { + assert(!ARY_EMBED_P(ary)); assert(!ARY_EMBED_P(tmp)); - if (ARY_EMBED_P(ary)) FL_UNSET_EMBED(ary); if (RARRAY_PTR(ary) != RARRAY_PTR(tmp)) { assert(!ARY_SHARED_P(tmp)); if (ARY_SHARED_P(ary)) { Index: ChangeLog =================================================================== --- ChangeLog (revision 20024) +++ ChangeLog (revision 20025) @@ -1,8 +1,3 @@ -Wed Oct 29 23:24:38 2008 Yusuke Endoh <mame@t...> - - * array.c (rb_ary_sort_bang): replacing array during sort broke - invariant of array. - Wed Oct 29 20:45:08 2008 Yusuke Endoh <mame@t...> * test/webrick/utils.rb (start_server): provide a reference to log of Index: ruby_1_9_1/array.c =================================================================== --- ruby_1_9_1/array.c (revision 20024) +++ ruby_1_9_1/array.c (revision 20025) @@ -1751,18 +1751,14 @@ ruby_qsort(RARRAY_PTR(tmp), RARRAY_LEN(tmp), sizeof(VALUE), rb_block_given_p()?sort_1:sort_2, &data); - if (ARY_EMBED_P(tmp)) { + if (ARY_EMBED_P(ary) || ARY_EMBED_P(tmp)) { assert(ARY_EMBED_P(tmp)); - if (ARY_SHARED_P(ary)) { /* ary might be destructively operated in the given block */ - rb_ary_unshared(ary); - FL_SET_EMBED(ary); - } MEMCPY(RARRAY_PTR(ary), ARY_EMBED_PTR(tmp), VALUE, ARY_EMBED_LEN(tmp)); ARY_SET_LEN(ary, ARY_EMBED_LEN(tmp)); } else { + assert(!ARY_EMBED_P(ary)); assert(!ARY_EMBED_P(tmp)); - if (ARY_EMBED_P(ary)) FL_UNSET_EMBED(ary); if (RARRAY_PTR(ary) != RARRAY_PTR(tmp)) { assert(!ARY_SHARED_P(tmp)); if (ARY_SHARED_P(ary)) { Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 20024) +++ ruby_1_9_1/ChangeLog (revision 20025) @@ -1,8 +1,3 @@ -Wed Oct 29 23:24:38 2008 Yusuke Endoh <mame@t...> - - * array.c (rb_ary_sort_bang): replacing array during sort broke - invariant of array. - Wed Oct 29 20:45:08 2008 Yusuke Endoh <mame@t...> * test/webrick/utils.rb (start_server): provide a reference to log of -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/