io.c (rb_f_backquote): trade volatile for manual recycle

* io.c (rb_f_backquote): trade volatile for manual recycle
  rb_gc_force_recycle ensures object is visible until recycle

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2014-02-16 04:19:29 +00:00
Родитель f97051512a
Коммит 10a8e87ce5
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Sun Feb 16 12:46:47 2014 Eric Wong <e@80x24.org>
* io.c (rb_f_backquote): trade volatile for manual recycle
rb_gc_force_recycle ensures object is visible until recycle
Sun Feb 16 11:55:14 2014 Eric Wong <e@80x24.org>
* marshal.c (marshal_dump): use rb_gc_force_recycle for GC-safety

4
io.c
Просмотреть файл

@ -8227,7 +8227,7 @@ argf_readlines(int argc, VALUE *argv, VALUE argf)
static VALUE
rb_f_backquote(VALUE obj, VALUE str)
{
volatile VALUE port;
VALUE port;
VALUE result;
rb_io_t *fptr;
@ -8239,6 +8239,8 @@ rb_f_backquote(VALUE obj, VALUE str)
GetOpenFile(port, fptr);
result = read_all(fptr, remain_size(fptr), Qnil);
rb_io_close(port);
rb_io_fptr_finalize(fptr);
rb_gc_force_recycle(port); /* also guards from premature GC */
return result;
}