summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-20 05:39:57 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-20 05:39:57 +0000
commit45e8268d62add210f3a9a93f677f255f96bb0cff (patch)
tree2b2ae9320f001fdf3a8c71d1a2d424bb2d8e408a /array.c
parente6a6dd8e7e1ef8acdf3c20137fa62926e60a4205 (diff)
* array.c (ary_make_shared): make shared array shady.
Making non-shady shared array causes SEGV (see rubyci). It seems a bug around shared array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/array.c b/array.c
index d69d111..30786f8 100644
--- a/array.c
+++ b/array.c
@@ -612,8 +612,8 @@ ary_make_shared(VALUE ary)
FL_UNSET_EMBED(shared);
ARY_SET_LEN((VALUE)shared, ARY_CAPA(ary));
- ARY_SET_PTR((VALUE)shared, RARRAY_RAWPTR(ary));
- ary_mem_clear((VALUE)shared, RARRAY_LEN(ary), ARY_CAPA(ary) - RARRAY_LEN(ary));
+ ARY_SET_PTR((VALUE)shared, RARRAY_PTR(ary));
+ rb_mem_clear(RARRAY_PTR(shared) + RARRAY_LEN(ary), ARY_CAPA(ary) - RARRAY_LEN(ary));
FL_SET_SHARED_ROOT(shared);
ARY_SET_SHARED_NUM((VALUE)shared, 1);
FL_SET_SHARED(ary);