1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

proc.c: method body GC guard

* proc.c (rb_mod_define_method): guard method body to prevent its
  method entry from GC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-10-12 13:24:35 +00:00
parent 13dd738d88
commit e9c5e7625c

1
proc.c
View file

@ -1719,6 +1719,7 @@ rb_mod_define_method(int argc, VALUE *argv, VALUE mod)
if (noex == NOEX_MODFUNC) {
rb_method_entry_set(rb_singleton_class(mod), id, method->me, NOEX_PUBLIC);
}
RB_GC_GUARD(body);
}
else if (rb_obj_is_proc(body)) {
rb_proc_t *proc;