Skip to content

Instantly share code, notes, and snippets.

@k-tsj
Last active December 13, 2015 18:08
Show Gist options
  • Select an option

  • Save k-tsj/4953202 to your computer and use it in GitHub Desktop.

Select an option

Save k-tsj/4953202 to your computer and use it in GitHub Desktop.
Bug #7825
diff --git a/vm.c b/vm.c
index 36def2c..89314c7 100644
--- a/vm.c
+++ b/vm.c
@@ -1782,7 +1782,14 @@ rb_thread_mark(void *ptr)
if (iseq) {
rb_gc_mark(RUBY_VM_NORMAL_ISEQ_P(iseq) ? iseq->self : (VALUE)iseq);
}
- if (cfp->me) ((rb_method_entry_t *)cfp->me)->mark = 1;
+ if (cfp->me) {
+ rb_method_entry_t *me = (rb_method_entry_t *)cfp->me;
+ rb_method_definition_t *def = me->def;
+ me->mark = 1;
+ if (def->type == VM_METHOD_TYPE_BMETHOD) {
+ rb_gc_mark(def->body.proc);
+ }
+ }
cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment