* string.c (str_replace_shared): change embedded state atomically.

[ruby-core:29953] [ruby-dev:41456]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2010-05-29 14:32:18 +00:00
parent 2f9d028202
commit 701c70e068
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Sat May 29 23:30:33 2010 Yusuke Endoh <mame@tsg.ne.jp>
* string.c (str_replace_shared): change embedded state atomically.
[ruby-core:29953] [ruby-dev:41456]
Sat May 29 12:56:09 2010 NARUSE, Yui <naruse@ruby-lang.org>
* encoding.c (rb_filesystem_encindex): avoid infinite require

View File

@ -613,8 +613,8 @@ str_replace_shared(VALUE str2, VALUE str)
STR_SET_EMBED_LEN(str2, RSTRING_LEN(str));
}
else {
FL_SET(str2, STR_NOEMBED);
str = rb_str_new_frozen(str);
FL_SET(str2, STR_NOEMBED);
RSTRING(str2)->as.heap.len = RSTRING_LEN(str);
RSTRING(str2)->as.heap.ptr = RSTRING_PTR(str);
RSTRING(str2)->as.heap.aux.shared = str;