summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2024-10-10 15:11:47 +0900
committerNobuyoshi Nakada <[email protected]>2024-10-11 16:52:01 +0900
commitb4eb7e2281d2abf3c33a4e9bc8a096be287970c1 (patch)
tree130b7d95e772477ee928a6912cc9a0fa573452af /vm_method.c
parent2c3d26cfd70277954e12e3af15432aadff8ad21f (diff)
Refine assertion failure message
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11879
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/vm_method.c b/vm_method.c
index e436538f56..fb6fe3b593 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -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)
{
if (def) method_definition_addref(def, complement);
- VM_ASSERT(!defined_class ||
- NIL_P(defined_class) || // negative cache
- RB_TYPE_P(defined_class, T_CLASS) || RB_TYPE_P(defined_class, T_ICLASS));
+ if (RTEST(defined_class)) {
+ // not negative cache
+ 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_definition_t **)&me->def) = def;
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;
}
-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 *
overloaded_cme_table(void)
{