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

rb_eql_opt,rb_equal_opt: purge stale cc

When on USE_EMBED_CI, cd is stored statically.  Previous use could cache
stale cd->cc, which could have already been GCed.  Need flush them.
This commit is contained in:
卜部昌平 2020-06-08 14:26:49 +09:00
parent ffe58b9c8b
commit 1016cff4ff
Notes: git 2020-06-09 09:53:14 +09:00

View file

@ -1799,15 +1799,14 @@ rb_equal_opt(VALUE obj1, VALUE obj2)
#if USE_EMBED_CI
static struct rb_call_data cd = {
.ci = vm_ci_new_id(idEq, 0, 1, 0),
.cc = &vm_empty_cc,
};
#else
struct rb_call_data cd = {
.ci = &VM_CI_ON_STACK(idEq, 0, 1, 0),
.cc = &vm_empty_cc,
};
#endif
cd.cc = &vm_empty_cc;
return opt_equality(NULL, obj1, obj2, &cd);
}
@ -1819,15 +1818,14 @@ rb_eql_opt(VALUE obj1, VALUE obj2)
#if USE_EMBED_CI
static struct rb_call_data cd = {
.ci = vm_ci_new_id(idEqlP, 0, 1, 0),
.cc = &vm_empty_cc,
};
#else
struct rb_call_data cd = {
.ci = &VM_CI_ON_STACK(idEqlP, 0, 1, 0),
.cc = &vm_empty_cc,
};
#endif
cd.cc = &vm_empty_cc;
return opt_equality(NULL, obj1, obj2, &cd);
}
#endif