diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-06-03 21:06:04 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-06-03 21:06:04 +0900 |
| commit | dece49750d161d74992854fb18d64d50bdaad0a9 (patch) | |
| tree | 3a7bba0580a8bca6eed80c1799374adf40d06971 /src/string.c | |
| parent | 361d0ca75d33b8618ea6e35f75eb64e4cfc8936d (diff) | |
| download | mruby-dece49750d161d74992854fb18d64d50bdaad0a9.tar.gz mruby-dece49750d161d74992854fb18d64d50bdaad0a9.zip | |
string.subseq should update shared refcnt
Diffstat (limited to 'src/string.c')
| -rw-r--r-- | src/string.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/string.c b/src/string.c index 2d5c67655..d7749c27b 100644 --- a/src/string.c +++ b/src/string.c @@ -1202,6 +1202,9 @@ mrb_str_subseq(mrb_state *mrb, mrb_value str, int beg, int len) s = mrb_obj_alloc_string(mrb); s->buf = shared->buf + beg; s->len = len; + s->aux.shared = shared; + s->flags |= MRB_STR_SHARED; + shared->refcnt++; return mrb_obj_value(s); } |
