summaryrefslogtreecommitdiff
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 c477e950a6..a1c58ffcda 100644
--- a/string.c
+++ b/string.c
@@ -3752,6 +3752,7 @@ rb_str_gsub(int argc, VALUE *argv, VALUE str)
VALUE
rb_str_replace(VALUE str, VALUE str2)
{
+ str_modifiable(str);
if (str == str2) return str;
StringValue(str2);