diff --git a/internal/class.h b/internal/class.h index 4a3e0afafb..b6da66a61d 100644 --- a/internal/class.h +++ b/internal/class.h @@ -658,6 +658,7 @@ RCLASS_SET_REFINED_CLASS(VALUE klass, VALUE refined) static inline rb_alloc_func_t RCLASS_ALLOCATOR(VALUE klass) { + RUBY_ASSERT(RB_TYPE_P(klass, T_CLASS) || RB_TYPE_P(klass, T_ICLASS)); if (RCLASS_SINGLETON_P(klass) || RB_TYPE_P(klass, T_ICLASS)) { return 0; }