summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-17 07:24:13 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-17 07:24:13 +0000
commit49dee548f4a509a98fe0726731fe120276114ef0 (patch)
tree86eee9979115f1b32297ad47e85e30eda6c3bb8c
parentd46e2aea718920f535c1dc701cbd6b85a8e1fcac (diff)
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
-rw-r--r--string.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/string.c b/string.c
index 3518cf5..0efcf49 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;