diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-23 02:03:35 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-23 02:03:35 +0000 |
commit | 3ec18aa23a9e6e94f53e8c4540342d1fe83896b0 (patch) | |
tree | 0bf8c3a021ee41235a30eb5c6b4d45e1f95779c4 /ext | |
parent | 43326170323f735820f64ca1413b01183da606b0 (diff) | |
download | ruby-3ec18aa23a9e6e94f53e8c4540342d1fe83896b0.tar.gz |
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')
-rw-r--r-- | ext/stringio/stringio.c | 2 |
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); } |