From 49dee548f4a509a98fe0726731fe120276114ef0 Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 17 Feb 2016 07:24:13 +0000 Subject: [PATCH] fix rubyspec error from r53850 http://rubyci.s3.amazonaws.com/tk2-243-31075/ruby-trunk/log/20160217T061402Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/string.c b/string.c index 3518cf5601..0efcf49b27 100644 --- a/string.c +++ b/string.c @@ -1363,6 +1363,7 @@ rb_str_resurrect(VALUE str) * times (and call many realloc). */ +static inline void str_modifiable(VALUE str); static VALUE rb_str_init(int argc, VALUE *argv, VALUE str) { @@ -1414,6 +1415,9 @@ rb_str_init(int argc, VALUE *argv, VALUE str) } else if (n == 1) { StringValue(orig); + if (OBJ_FROZEN(str)) { + rb_error_frozen_object(str); + } str_replace(str, orig); } return str;