summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-12 07:41:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-12 07:41:40 +0000
commit221496de7cb970c67de14766c4aecb314626ded1 (patch)
treeddf680b0d73609b32de35dcbbd66ceb5926fb706 /array.c
parentc3b81910196894e486fec0c0a5a1273fc35955ea (diff)
array.c: fix false assertions
* 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
Diffstat (limited to 'array.c')
-rw-r--r--array.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/array.c b/array.c
index f3076d7..da22b4c 100644
--- a/array.c
+++ b/array.c
@@ -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));
}