Unverified Commit 021f228f authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4919 from shuujii/revert-SHARED-string-is-not-required-when-sharing-POOL-string

Revert "SHARED string is not required when sharing POOL string" (75949836)
parents 7247e4cf 40b8490f
...@@ -553,7 +553,7 @@ str_share(mrb_state *mrb, struct RString *orig, struct RString *s) ...@@ -553,7 +553,7 @@ str_share(mrb_state *mrb, struct RString *orig, struct RString *s)
size_t len = (size_t)orig->as.heap.len; size_t len = (size_t)orig->as.heap.len;
mrb_assert(!RSTR_EMBED_P(orig)); mrb_assert(!RSTR_EMBED_P(orig));
if (RSTR_NOFREE_P(orig) || RSTR_POOL_P(orig)) { if (RSTR_NOFREE_P(orig)) {
str_init_nofree(s, orig->as.heap.ptr, len); str_init_nofree(s, orig->as.heap.ptr, len);
} }
else if (RSTR_SHARED_P(orig)) { else if (RSTR_SHARED_P(orig)) {
...@@ -562,7 +562,7 @@ str_share(mrb_state *mrb, struct RString *orig, struct RString *s) ...@@ -562,7 +562,7 @@ str_share(mrb_state *mrb, struct RString *orig, struct RString *s)
else if (RSTR_FSHARED_P(orig)) { else if (RSTR_FSHARED_P(orig)) {
str_init_fshared(orig, s, orig->as.heap.aux.fshared); str_init_fshared(orig, s, orig->as.heap.aux.fshared);
} }
else if (mrb_frozen_p(orig)) { else if (mrb_frozen_p(orig) && !RSTR_POOL_P(orig)) {
str_init_fshared(orig, s, orig); str_init_fshared(orig, s, orig);
} }
else { else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment