summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/string.c b/string.c
index a65a423b8f2..3a7113dcc00 100644
--- a/string.c
+++ b/string.c
@@ -1150,7 +1150,11 @@ rb_str_tmp_frozen_release(VALUE orig, VALUE tmp)
if (RBASIC_CLASS(tmp) != 0)
return;
- if (FL_TEST_RAW(orig, STR_SHARED) &&
+ if (STR_EMBED_P(tmp)) {
+ assert(OBJ_FROZEN_RAW(tmp));
+ rb_gc_force_recycle(tmp);
+ }
+ else if (FL_TEST_RAW(orig, STR_SHARED) &&
!FL_TEST_RAW(orig, STR_TMPLOCK|RUBY_FL_FREEZE)) {
VALUE shared = RSTRING(orig)->as.heap.aux.shared;
@@ -1164,10 +1168,6 @@ rb_str_tmp_frozen_release(VALUE orig, VALUE tmp)
rb_gc_force_recycle(tmp);
}
}
- else if (STR_EMBED_P(tmp)) {
- assert(OBJ_FROZEN_RAW(tmp));
- rb_gc_force_recycle(tmp);
- }
}
static VALUE