Unverified Commit 0f64cb42 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4811 from shuujii/clear-MRB_STR_SHARED-flag-in-mrb_str_modify_keep_ascii

Clear `MRB_STR_SHARED` flag in `mrb_str_modify_keep_ascii`; close #4807
parents c10e191a 45aa5081
...@@ -820,6 +820,7 @@ mrb_str_modify_keep_ascii(mrb_state *mrb, struct RString *s) ...@@ -820,6 +820,7 @@ mrb_str_modify_keep_ascii(mrb_state *mrb, struct RString *s)
if (shared->refcnt == 1 && s->as.heap.ptr == shared->ptr) { if (shared->refcnt == 1 && s->as.heap.ptr == shared->ptr) {
s->as.heap.aux.capa = shared->capa; s->as.heap.aux.capa = shared->capa;
s->as.heap.ptr[s->as.heap.len] = '\0'; s->as.heap.ptr[s->as.heap.len] = '\0';
RSTR_UNSET_SHARED_FLAG(s);
mrb_free(mrb, shared); mrb_free(mrb, shared);
} }
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