summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-09 08:40:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-09 08:40:18 +0000
commita28de81aec2cb6af9199891f2fba17efc6f1ebc8 (patch)
tree0ab4d8297923894c766f0a69cae276886c9bfa95 /string.c
parentb1b4724ea0c6e96e15d0f448b8185972e108238b (diff)
string.c: mark frozen string
* string.c (rb_fstring): because of lazy sweep, str may be unmaked already and swept at next time, so mark it for the time being. [ruby-core:57756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/string.c b/string.c
index 7bf4006fdf..6512fe4092 100644
--- a/string.c
+++ b/string.c
@@ -146,6 +146,9 @@ rb_fstring(VALUE str)
st_data_t fstr;
if (st_lookup(frozen_strings, (st_data_t)str, &fstr)) {
str = (VALUE)fstr;
+ /* because of lazy sweep, str may be unmaked already and swept
+ * at next time */
+ rb_gc_mark(str);
}
else {
str = rb_str_new_frozen(str);