From 6f4c585bd73fc43fb9e34a70d74b5a50852600ea Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Sun, 24 May 2020 01:25:03 +0900 Subject: 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]`. --- include/mruby/array.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/mruby/array.h b/include/mruby/array.h index fd4094a02..92c86a8c5 100644 --- a/include/mruby/array.h +++ b/include/mruby/array.h @@ -292,6 +292,9 @@ MRB_API mrb_value mrb_ary_join(mrb_state *mrb, mrb_value ary, mrb_value sep); */ MRB_API mrb_value mrb_ary_resize(mrb_state *mrb, mrb_value ary, mrb_int new_len); +/* helper functions */ +mrb_value mrb_ary_subseq(mrb_state *mrb, mrb_value ary, mrb_int beg, mrb_int len); + MRB_END_DECL #endif /* MRUBY_ARRAY_H */ -- cgit v1.2.3