summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-09-10 20:35:42 +0900
committerYukihiro Matsumoto <[email protected]>2012-09-10 20:35:42 +0900
commitfd252fecf4f20284dddfcd7d5b9f019ceefef16d (patch)
tree991dd38c8df7e5d7995e37e5e249f028d5823bcb /src
parentd416a5c3fe3682983cc365585aa6ac2b09763e4b (diff)
downloadmruby-fd252fecf4f20284dddfcd7d5b9f019ceefef16d.tar.gz
mruby-fd252fecf4f20284dddfcd7d5b9f019ceefef16d.zip
check special_const before calling respond_to?
Diffstat (limited to 'src')
-rw-r--r--src/array.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/array.c b/src/array.c
index 15b6df0f2..4992d3281 100644
--- a/src/array.c
+++ b/src/array.c
@@ -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();