Unverified Commit ddcb30d8 authored by ksss's avatar ksss

Check intern object returned by mrb_check_string_type

parent 158a6ab2
...@@ -965,14 +965,17 @@ obj_respond_to(mrb_state *mrb, mrb_value self) ...@@ -965,14 +965,17 @@ obj_respond_to(mrb_state *mrb, mrb_value self)
} }
else { else {
mrb_value tmp; mrb_value tmp;
if (!mrb_string_p(mid)) { if (mrb_string_p(mid)) {
tmp = mrb_check_intern_str(mrb, mid);
}
else {
tmp = mrb_check_string_type(mrb, mid); tmp = mrb_check_string_type(mrb, mid);
if (mrb_nil_p(tmp)) { if (mrb_nil_p(tmp)) {
tmp = mrb_inspect(mrb, mid); tmp = mrb_inspect(mrb, mid);
mrb_raisef(mrb, E_TYPE_ERROR, "%S is not a symbol", tmp); mrb_raisef(mrb, E_TYPE_ERROR, "%S is not a symbol", tmp);
} }
tmp = mrb_check_intern_str(mrb, tmp);
} }
tmp = mrb_check_intern_str(mrb, mid);
if (mrb_nil_p(tmp)) { if (mrb_nil_p(tmp)) {
respond_to_p = FALSE; respond_to_p = FALSE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment