check special_const before calling respond_to?

This commit is contained in:
Yukihiro Matsumoto
2012-09-10 20:35:42 +09:00
parent d416a5c3fe
commit fd252fecf4
+2 -1
View File
@@ -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();