summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-11-08 08:12:23 +0900
committerGitHub <[email protected]>2019-11-08 08:12:23 +0900
commit0f64cb421e14cb240ccf4631924ea8d2493f22a8 (patch)
treee86f696e4dcead36e4b8ac3fca0795c264929504 /src/string.c
parentc10e191ac70a78f99a1255dfa1bd9d7ffa803eb7 (diff)
parent45aa5081e418423b47a32a06e0515406f63b64d2 (diff)
downloadmruby-0f64cb421e14cb240ccf4631924ea8d2493f22a8.tar.gz
mruby-0f64cb421e14cb240ccf4631924ea8d2493f22a8.zip
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
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/string.c b/src/string.c
index b69a39df8..251e00628 100644
--- a/src/string.c
+++ b/src/string.c
@@ -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) {
s->as.heap.aux.capa = shared->capa;
s->as.heap.ptr[s->as.heap.len] = '\0';
+ RSTR_UNSET_SHARED_FLAG(s);
mrb_free(mrb, shared);
}
else {