Skip to content

Commit

Permalink
vm_call_method: avoid marking on-stack object
Browse files Browse the repository at this point in the history
This callcache is on stack, must not be GCed.  However its contents are
copied from other materials, which can be an ordinal object.  Should
set a flag to make sure it is properly skipped by the GC.
  • Loading branch information
shyouhei committed Jun 10, 2020
1 parent 8bee9e5 commit 5648976
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vm_insnhelper.c
Expand Up @@ -3183,7 +3183,8 @@ vm_call_method(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_ca
else {
/* caching method info to dummy cc */
VM_ASSERT(vm_cc_cme(cc) != NULL);
const struct rb_callcache cc_on_stack = *cc;
struct rb_callcache cc_on_stack = *cc;
FL_SET_RAW((VALUE)&cc_on_stack, VM_CALLCACHE_UNMARKABLE);
struct rb_call_data dummy = {
.ci = ci,
.cc = &cc_on_stack,
Expand Down

0 comments on commit 5648976

Please sign in to comment.