From 72bf46de2213b09a03da6c99bcbe9b462a154899 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sun, 30 Jun 2024 18:19:52 +0900 Subject: [PATCH] array.c (mrb_ary_cmp): fixed wrong type casting --- src/array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/array.c b/src/array.c index 21e7f5aa1..fd9d399d0 100644 --- a/src/array.c +++ b/src/array.c @@ -1501,7 +1501,7 @@ mrb_ary_cmp(mrb_state *mrb, mrb_value ary1) if (n == -2) return mrb_nil_value(); if (n != 0) return mrb_fixnum_value(n); } - len = RSTRING_LEN(ary1) - RSTRING_LEN(ary2); + len = RARRAY_LEN(ary1) - RARRAY_LEN(ary2); if (len == 0) return mrb_fixnum_value(0); else if (len > 0) return mrb_fixnum_value(1); else return mrb_fixnum_value(-1);