Skip to content

Commit

Permalink
check special_const before calling respond_to?
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Sep 10, 2012
1 parent d416a5c commit fd252fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/array.c
Expand Up @@ -1054,7 +1054,8 @@ mrb_ary_equal(mrb_state *mrb, mrb_value ary1)
mrb_value ary2;

mrb_get_args(mrb, "o", &ary2);
if (mrb_obj_equal(mrb, ary1,ary2)) return mrb_true_value();
if (mrb_obj_equal(mrb, ary1, ary2)) return mrb_true_value();
if (SPECIAL_CONST_P(ary2)) return mrb_false_value();
if (mrb_type(ary2) != MRB_TT_ARRAY) {
if (!mrb_respond_to(mrb, ary2, mrb_intern(mrb, "to_ary"))) {
return mrb_false_value();
Expand Down

0 comments on commit fd252fe

Please sign in to comment.