mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 05:29:10 +02:00
Add stricter assertions on CC access
This commit is contained in:
parent
640a2f1dc7
commit
fccd96cc6c
1 changed files with 4 additions and 0 deletions
|
@ -418,6 +418,8 @@ 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(cc->klass != Qundef || !vm_cc_markable(cc));
|
||||
VM_ASSERT(cc_check_class(cc->klass));
|
||||
VM_ASSERT(cc->call_ == NULL || // not initialized yet
|
||||
!vm_cc_markable(cc) ||
|
||||
cc->cme_ != NULL);
|
||||
|
@ -430,6 +432,8 @@ vm_cc_call(const struct rb_callcache *cc)
|
|||
{
|
||||
VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
|
||||
VM_ASSERT(cc->call_ != NULL);
|
||||
VM_ASSERT(cc->klass != Qundef || !vm_cc_markable(cc));
|
||||
VM_ASSERT(cc_check_class(cc->klass));
|
||||
return cc->call_;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue