aboutsummaryrefslogtreecommitdiffstats
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 3eaeb9e5db..e20007f0b9 100644
--- a/string.c
+++ b/string.c
@@ -1996,6 +1996,7 @@ rb_str_subpat_set(VALUE str, VALUE re, int nth, VALUE val)
}
end = RMATCH(match)->END(nth);
len = end - start;
+ StringValue(val);
rb_enc_check(str, val);
rb_str_splice_0(str, start, len, val);
}