diff --git a/class.c b/class.c index 4c469ffaeb..b7247e7489 100644 --- a/class.c +++ b/class.c @@ -1435,6 +1435,7 @@ method_entry_i(ID key, VALUE value, void *data) } else { type = METHOD_ENTRY_VISI(me); + RUBY_ASSERT(type != METHOD_VISI_UNDEF); } st_add_direct(arg->list, key, (st_data_t)type); } diff --git a/proc.c b/proc.c index d4236d0061..bf04f4c26d 100644 --- a/proc.c +++ b/proc.c @@ -1657,6 +1657,7 @@ mnew_internal(const rb_method_entry_t *me, VALUE klass, VALUE iclass, } if (visi == METHOD_VISI_UNDEF) { visi = METHOD_ENTRY_VISI(me); + RUBY_ASSERT(visi != METHOD_VISI_UNDEF); /* !UNDEFINED_METHOD_ENTRY_P(me) */ if (scope && (visi != METHOD_VISI_PUBLIC)) { if (!error) return Qnil; rb_print_inaccessible(klass, id, visi);