* 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
This commit is contained in:
ko1 2013-07-20 05:39:57 +00:00
Родитель e6a6dd8e7e
Коммит 45e8268d62
2 изменённых файлов: 8 добавлений и 2 удалений

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

@ -1,3 +1,9 @@
Sat Jul 20 14:38:00 2013 Koichi Sasada <ko1@atdot.net>
* 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@ruby-lang.org>
* string.c (enc_succ_char, enc_pred_char): consider wchar case.

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

@ -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);