diff --git a/mrbgems/mruby-struct/src/struct.c b/mrbgems/mruby-struct/src/struct.c index f0d3d5edc..72e4e64bb 100644 --- a/mrbgems/mruby-struct/src/struct.c +++ b/mrbgems/mruby-struct/src/struct.c @@ -524,7 +524,9 @@ mrb_struct_equal(mrb_state *mrb, mrb_value s) if (mrb_obj_class(mrb, s) != mrb_obj_class(mrb, s2)) { return mrb_false_value(); } - mrb_assert(RSTRUCT_LEN(s) == RSTRUCT_LEN(s2)); + if (RSTRUCT_LEN(s) != RSTRUCT_LEN(s2)) { + return mrb_false_value(); + } ptr = RSTRUCT_PTR(s); ptr2 = RSTRUCT_PTR(s2); len = RSTRUCT_LEN(s); @@ -558,7 +560,9 @@ mrb_struct_eql(mrb_state *mrb, mrb_value s) if (mrb_obj_class(mrb, s) != mrb_obj_class(mrb, s2)) { return mrb_false_value(); } - mrb_assert(RSTRUCT_LEN(s) == RSTRUCT_LEN(s2)); + if (RSTRUCT_LEN(s) != RSTRUCT_LEN(s2)) { + return mrb_false_value(); + } ptr = RSTRUCT_PTR(s); ptr2 = RSTRUCT_PTR(s2); len = RSTRUCT_LEN(s);