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

assert cc->cme_ != NULL

when `vm_cc_markable(cc)`.
This commit is contained in:
Koichi Sasada 2021-11-16 18:02:16 +09:00
parent b2255153cf
commit 8d7116552d
Notes: git 2021-11-17 22:22:04 +09:00

View file

@ -321,10 +321,19 @@ vm_cc_class_check(const struct rb_callcache *cc, VALUE klass)
return cc->klass == klass;
}
static inline int
vm_cc_markable(const struct rb_callcache *cc)
{
VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
return FL_TEST_RAW((VALUE)cc, VM_CALLCACHE_UNMARKABLE) == 0;
}
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);
return cc->cme_;
}
@ -350,13 +359,6 @@ vm_cc_cmethod_missing_reason(const struct rb_callcache *cc)
return cc->aux_.method_missing_reason;
}
static inline int
vm_cc_markable(const struct rb_callcache *cc)
{
VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
return FL_TEST_RAW((VALUE)cc, VM_CALLCACHE_UNMARKABLE) == 0;
}
static inline bool
vm_cc_invalidated_p(const struct rb_callcache *cc)
{