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

fix assertion on gc_cc_cme()

`cc->cme_` can be NULL when it is not initialized yet.
It can be observed on `GC.stress == true` running.
This commit is contained in:
Koichi Sasada 2021-11-25 12:18:15 +09:00
parent aceb75f6c9
commit ca21eed6eb
Notes: git 2021-11-25 13:58:16 +09:00

View file

@ -334,7 +334,9 @@ static inline const struct rb_callable_method_entry_struct *
vm_cc_cme(const struct rb_callcache *cc)
{
VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
VM_ASSERT(!vm_cc_markable(cc) || cc->cme_ != NULL);
VM_ASSERT(cc->call_ == NULL || // not initialized yet
!vm_cc_markable(cc) ||
cc->cme_ != NULL);
return cc->cme_;
}