Stricter assert for RCLASS_ALLOCATOR
I'd like to make this only valid to T_CLASS also, but currently it is called in some places for T_ICLASS and expected to return 0.
This commit is contained in:
parent
05cdcfcefd
commit
4f9f2243e9
Notes:
git
2025-05-23 17:34:00 +00:00
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user