Commit 21c1e2fd authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

shared strings should not chain

parent 00c6022c
......@@ -1211,6 +1211,9 @@ str_subseq(mrb_state *mrb, mrb_value str, long beg, long len)
str2 = mrb_str_new_with_class(mrb, str, 0, 0);
orig = mrb_str_ptr(str);
while (orig->flags & MRB_STR_SHARED) {
orig = orig->aux.shared;
}
s = mrb_str_ptr(str2);
s->buf = orig->buf + beg;
s->len = len;
......
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