summaryrefslogtreecommitdiff
path: root/ext/stringio
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-23 02:03:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-23 02:03:35 +0000
commit3ec18aa23a9e6e94f53e8c4540342d1fe83896b0 (patch)
tree0bf8c3a021ee41235a30eb5c6b4d45e1f95779c4 /ext/stringio
parent43326170323f735820f64ca1413b01183da606b0 (diff)
stringio.c: move GC guard
* ext/stringio/stringio.c (strio_write): move GC guard after the last using position. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/stringio')
-rw-r--r--ext/stringio/stringio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index e964e79e12..f44bdc602f 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -1170,7 +1170,6 @@ strio_write(VALUE self, VALUE str)
long len, olen;
rb_encoding *enc, *enc2;
- RB_GC_GUARD(str);
if (!RB_TYPE_P(str, T_STRING))
str = rb_obj_as_string(str);
enc = rb_enc_get(ptr->string);
@@ -1194,6 +1193,7 @@ strio_write(VALUE self, VALUE str)
OBJ_INFECT(ptr->string, str);
}
OBJ_INFECT(ptr->string, self);
+ RB_GC_GUARD(str);
ptr->pos += len;
return LONG2NUM(len);
}