mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Fix mrb_ary_splat to copy the array; fix #5067
This commit is contained in:
+3
-1
@@ -1081,7 +1081,9 @@ mrb_ary_splat(mrb_state *mrb, mrb_value v)
|
||||
mrb_value a;
|
||||
|
||||
if (mrb_array_p(v)) {
|
||||
return v;
|
||||
struct RArray *a = mrb_ary_ptr(v);
|
||||
a = ary_dup(mrb, a);
|
||||
return mrb_obj_value(a);
|
||||
}
|
||||
|
||||
if (!mrb_respond_to(mrb, v, mrb_intern_lit(mrb, "to_a"))) {
|
||||
|
||||
Reference in New Issue
Block a user