Fix mrb_ary_splat() to copy the array always.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-08-30 19:14:34 +09:00
parent 705f95c983
commit e2c628583e
+2 -5
View File
@@ -1096,11 +1096,8 @@ mrb_ary_splat(mrb_state *mrb, mrb_value v)
}
mrb_ensure_array_type(mrb, ary);
a = mrb_ary_ptr(ary);
if (mrb_frozen_p(a)) {
a = ary_dup(mrb, a);
return mrb_obj_value(a);
}
return ary;
a = ary_dup(mrb, a);
return mrb_obj_value(a);
}
static mrb_value