Should not make empty strings shared; fix #3407

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-01-23 10:52:40 +09:00
parent 49fd7590df
commit 708088c5fa
+1 -1
View File
@@ -423,7 +423,7 @@ byte_subseq(mrb_state *mrb, mrb_value str, mrb_int beg, mrb_int len)
mrb_shared_string *shared;
orig = mrb_str_ptr(str);
if (RSTR_EMBED_P(orig)) {
if (RSTR_EMBED_P(orig) || RSTR_LEN(orig) == 0) {
s = str_new(mrb, orig->as.ary+beg, len);
}
else {