Skip to content

Commit

Permalink
Merge pull request #4811 from shuujii/clear-MRB_STR_SHARED-flag-in-mr…
Browse files Browse the repository at this point in the history
…b_str_modify_keep_ascii

Clear `MRB_STR_SHARED` flag in `mrb_str_modify_keep_ascii`; close #4807
  • Loading branch information
matz committed Nov 7, 2019
2 parents c10e191 + 45aa508 commit 0f64cb4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0f64cb4

Please sign in to comment.