ruby-changes:30027
From: ko1 <ko1@a...>
Date: Sat, 20 Jul 2013 14:40:07 +0900 (JST)
Subject: [ruby-changes:30027] ko1:r42079 (trunk): * array.c (ary_make_shared): make shared array shady.
ko1 2013-07-20 14:39:57 +0900 (Sat, 20 Jul 2013) New Revision: 42079 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42079 Log: * 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. Modified files: trunk/ChangeLog trunk/array.c Index: array.c =================================================================== --- array.c (revision 42078) +++ array.c (revision 42079) @@ -612,8 +612,8 @@ ary_make_shared(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L612 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); Index: ChangeLog =================================================================== --- ChangeLog (revision 42078) +++ ChangeLog (revision 42079) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Jul 20 14:38:00 2013 Koichi Sasada <ko1@a...> + + * 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. + Sat Jul 20 12:14:07 2013 Nobuyoshi Nakada <nobu@r...> * string.c (enc_succ_char, enc_pred_char): consider wchar case. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/