summaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/string.c b/string.c
index 4c6301f56..95d48289e 100644
--- a/string.c
+++ b/string.c
@@ -1834,6 +1834,7 @@ rb_str_aref_m(int argc, VALUE *argv, VALUE str)
static void
rb_str_splice_0(VALUE str, long beg, long len, VALUE val)
{
+ rb_str_modify(str);
if (len < RSTRING_LEN(val)) {
/* expand string */
RESIZE_CAPA(str, RSTRING_LEN(str) + RSTRING_LEN(val) - len + 1);