mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Do not destruct rest arguments for __send__
Formerly, `__send__(*args)` modified `args` with `Array#shift`. This bug affects optcarrot. This changeset avoids the array destruction by using `args = args[1, len-1]`.
This commit is contained in:
@@ -808,6 +808,13 @@ ary_subseq(mrb_state *mrb, struct RArray *a, mrb_int beg, mrb_int len)
|
||||
return mrb_obj_value(b);
|
||||
}
|
||||
|
||||
mrb_value
|
||||
mrb_ary_subseq(mrb_state *mrb, mrb_value ary, mrb_int beg, mrb_int len)
|
||||
{
|
||||
struct RArray *a = mrb_ary_ptr(ary);
|
||||
return ary_subseq(mrb, a, beg, len);
|
||||
}
|
||||
|
||||
static mrb_int
|
||||
aget_index(mrb_state *mrb, mrb_value index)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user