mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Should not make empty strings shared; fix #3407
This commit is contained in:
+1
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user