summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-12 03:00:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-12 03:00:24 +0000
commitff7bb4723b88ce6461ef6276a441fae4c69bd71d (patch)
tree44cbe1ed6ce7996260c2b98fce40c894632710f0 /array.c
parent299d96cadd2015b0f40ceae322c7551bf55a0223 (diff)
array.c: fix false assertion
* array.c (FL_SET_EMBED): shared object is frozen even when get unshared. * array.c (rb_ary_modify): ARY_SET_CAPA needs unshared array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/array.c b/array.c
index e8920c0..400403e 100644
--- a/array.c
+++ b/array.c
@@ -65,7 +65,6 @@ memfill(register VALUE *mem, register long size, register VALUE val)
#define ARY_OWNS_HEAP_P(a) (!FL_TEST((a), ELTS_SHARED|RARRAY_EMBED_FLAG))
#define FL_SET_EMBED(a) do { \
assert(!ARY_SHARED_P(a)); \
- assert(!OBJ_FROZEN(a)); \
FL_SET((a), RARRAY_EMBED_FLAG); \
} while (0)
#define FL_UNSET_EMBED(ary) FL_UNSET((ary), RARRAY_EMBED_FLAG|RARRAY_EMBED_LEN_MASK)
@@ -279,10 +278,10 @@ rb_ary_modify(VALUE ary)
}
else if (ARY_SHARED_NUM(shared) == 1 && len > (RARRAY_LEN(shared)>>1)) {
long shift = RARRAY_PTR(ary) - RARRAY_PTR(shared);
+ FL_UNSET_SHARED(ary);
ARY_SET_PTR(ary, RARRAY_PTR(shared));
ARY_SET_CAPA(ary, RARRAY_LEN(shared));
MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+shift, VALUE, len);
- FL_UNSET_SHARED(ary);
FL_SET_EMBED(shared);
rb_ary_decrement_share(shared);
}