summaryrefslogtreecommitdiff
path: root/internal/class.h
diff options
context:
space:
mode:
Diffstat (limited to 'internal/class.h')
-rw-r--r--internal/class.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/class.h b/internal/class.h
index 15530b8842..4a3e0afafb 100644
--- a/internal/class.h
+++ b/internal/class.h
@@ -667,7 +667,8 @@ RCLASS_ALLOCATOR(VALUE klass)
static inline void
RCLASS_SET_ALLOCATOR(VALUE klass, rb_alloc_func_t allocator)
{
- assert(!RCLASS_SINGLETON_P(klass));
+ RUBY_ASSERT(RB_TYPE_P(klass, T_CLASS));
+ RUBY_ASSERT(!RCLASS_SINGLETON_P(klass));
RCLASS_EXT_PRIME(klass)->as.class.allocator = allocator; // Allocator is set only on the initial definition
}