* array.c (rb_ary_sort_bang): remove duplicated assertions.
  ARY_HEAP_PTR() implies ary not to be embedded.  [ruby-dev:47419]
  [Bug #8518]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-06-12 07:41:40 +00:00
Родитель c3b8191019
Коммит 221496de7c
2 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Wed Jun 12 16:41:38 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* array.c (rb_ary_sort_bang): remove duplicated assertions.
ARY_HEAP_PTR() implies ary not to be embedded. [ruby-dev:47419]
[Bug #8518]
Wed Jun 12 12:44:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (io_getc): fix 7bit coderange condition, check if ascii read

Просмотреть файл

@ -2323,7 +2323,6 @@ rb_ary_sort_bang(VALUE ary)
rb_ary_modify(ary);
if (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_unshare(ary);
}
@ -2332,9 +2331,7 @@ rb_ary_sort_bang(VALUE ary)
ARY_SET_LEN(ary, ARY_EMBED_LEN(tmp));
}
else {
assert(!ARY_EMBED_P(tmp));
if (ARY_HEAP_PTR(ary) == ARY_HEAP_PTR(tmp)) {
assert(!ARY_EMBED_P(ary));
if (!ARY_EMBED_P(ary) && ARY_HEAP_PTR(ary) == ARY_HEAP_PTR(tmp)) {
FL_UNSET_SHARED(ary);
ARY_SET_CAPA(ary, RARRAY_LEN(tmp));
}