From 93f364d65e25187ce3c1dd5172a00264804e9380 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 4 Nov 2022 09:02:58 -0400 Subject: Use RTEST to to check return value rb_obj_is_kind_of returns a Ruby Qtrue or Qfalse. We should use RTEST rather than assuming that Qfalse is 0. --- proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proc.c b/proc.c index 1f047cd04f..a25786c015 100644 --- a/proc.c +++ b/proc.c @@ -2571,7 +2571,7 @@ convert_umethod_to_method_components(const struct METHOD *data, VALUE recv, VALU VALUE refined_class = rb_refinement_module_get_refined_class(methclass); if (!NIL_P(refined_class)) methclass = refined_class; } - if (!RB_TYPE_P(methclass, T_MODULE) && !rb_obj_is_kind_of(recv, methclass)) { + if (!RB_TYPE_P(methclass, T_MODULE) && !RTEST(rb_obj_is_kind_of(recv, methclass))) { if (FL_TEST(methclass, FL_SINGLETON)) { rb_raise(rb_eTypeError, "singleton method called for a different object"); -- cgit v1.2.3