From eaaa4746302cc44634063f8f43805bf24fdffec3 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 28 Mar 2023 23:25:45 +0900 Subject: [PATCH] mruby-method/method.c: fix proc comparison for uncovered case --- mrbgems/mruby-method/src/method.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mrbgems/mruby-method/src/method.c b/mrbgems/mruby-method/src/method.c index dd7833b7e..f02d9bd1a 100644 --- a/mrbgems/mruby-method/src/method.c +++ b/mrbgems/mruby-method/src/method.c @@ -214,11 +214,11 @@ method_eql(mrb_state *mrb, mrb_value self) orig_proc = IV_GET(self, MRB_SYM(_proc)); other_proc = IV_GET(other, MRB_SYM(_proc)); - if (mrb_nil_p(orig_proc)) { - if (mrb_nil_p(other_proc)) { - if (mrb_symbol(IV_GET(self, MRB_SYM(_name))) == mrb_symbol(IV_GET(other, MRB_SYM(_name)))) - return mrb_true_value(); - } + if (mrb_nil_p(orig_proc) && mrb_nil_p(other_proc) && + mrb_symbol(IV_GET(self, MRB_SYM(_name))) == mrb_symbol(IV_GET(other, MRB_SYM(_name)))) { + return mrb_true_value(); + } + if (mrb_nil_p(orig_proc) || mrb_nil_p(other_proc)) { return mrb_false_value(); } return mrb_bool_value(mrb_proc_eql(mrb, orig_proc, other_proc));