Should not check/call `to_str` for immediate objects; ref #3515

parent 527dcd52
...@@ -1048,15 +1048,17 @@ join_ary(mrb_state *mrb, mrb_value ary, mrb_value sep, mrb_value list) ...@@ -1048,15 +1048,17 @@ join_ary(mrb_state *mrb, mrb_value ary, mrb_value sep, mrb_value list)
break; break;
default: default:
tmp = mrb_check_string_type(mrb, val); if (!mrb_immediate_p(val)) {
if (!mrb_nil_p(tmp)) { tmp = mrb_check_string_type(mrb, val);
val = tmp; if (!mrb_nil_p(tmp)) {
goto str_join; val = tmp;
} goto str_join;
tmp = mrb_check_convert_type(mrb, val, MRB_TT_ARRAY, "Array", "to_ary"); }
if (!mrb_nil_p(tmp)) { tmp = mrb_check_convert_type(mrb, val, MRB_TT_ARRAY, "Array", "to_ary");
val = tmp; if (!mrb_nil_p(tmp)) {
goto ary_join; val = tmp;
goto ary_join;
}
} }
val = mrb_obj_as_string(mrb, val); val = mrb_obj_as_string(mrb, val);
goto str_join; goto str_join;
......
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