Refine assertion failure message

This commit is contained in:
Nobuyoshi Nakada 2024-10-10 15:11:47 +09:00
parent 2c3d26cfd7
commit b4eb7e2281
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465
Notes: git 2024-10-11 09:27:38 +00:00

View File

@ -759,9 +759,11 @@ static rb_method_entry_t *
rb_method_entry_alloc(ID called_id, VALUE owner, VALUE defined_class, rb_method_definition_t *def, bool complement) rb_method_entry_alloc(ID called_id, VALUE owner, VALUE defined_class, rb_method_definition_t *def, bool complement)
{ {
if (def) method_definition_addref(def, complement); if (def) method_definition_addref(def, complement);
VM_ASSERT(!defined_class || if (RTEST(defined_class)) {
NIL_P(defined_class) || // negative cache // not negative cache
RB_TYPE_P(defined_class, T_CLASS) || RB_TYPE_P(defined_class, T_ICLASS)); VM_ASSERT(RB_TYPE_P(defined_class, T_CLASS) || RB_TYPE_P(defined_class, T_ICLASS),
"defined_class: %s", rb_obj_info(defined_class));
}
rb_method_entry_t *me = IMEMO_NEW(rb_method_entry_t, imemo_ment, defined_class); rb_method_entry_t *me = IMEMO_NEW(rb_method_entry_t, imemo_ment, defined_class);
*((rb_method_definition_t **)&me->def) = def; *((rb_method_definition_t **)&me->def) = def;
me->called_id = called_id; me->called_id = called_id;
@ -1083,8 +1085,6 @@ rb_method_entry_make(VALUE klass, ID mid, VALUE defined_class, rb_method_visibil
return me; return me;
} }
static rb_method_entry_t *rb_method_entry_alloc(ID called_id, VALUE owner, VALUE defined_class, rb_method_definition_t *def, bool refined);
static st_table * static st_table *
overloaded_cme_table(void) overloaded_cme_table(void)
{ {