Commit dece4975 authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

string.subseq should update shared refcnt

parent 361d0ca7
...@@ -1202,6 +1202,9 @@ mrb_str_subseq(mrb_state *mrb, mrb_value str, int beg, int len) ...@@ -1202,6 +1202,9 @@ mrb_str_subseq(mrb_state *mrb, mrb_value str, int beg, int len)
s = mrb_obj_alloc_string(mrb); s = mrb_obj_alloc_string(mrb);
s->buf = shared->buf + beg; s->buf = shared->buf + beg;
s->len = len; s->len = len;
s->aux.shared = shared;
s->flags |= MRB_STR_SHARED;
shared->refcnt++;
return mrb_obj_value(s); return mrb_obj_value(s);
} }
......
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