diff options
| author | Yusuke Endoh <[email protected]> | 2020-05-24 01:25:03 +0900 |
|---|---|---|
| committer | Yusuke Endoh <[email protected]> | 2020-05-24 01:25:03 +0900 |
| commit | 6f4c585bd73fc43fb9e34a70d74b5a50852600ea (patch) | |
| tree | 588252a0fdbd163af58a85b85b43804fd17a1935 /src/vm.c | |
| parent | 47ea60814b61d6f52a71b4799b4143f59191ff82 (diff) | |
| download | mruby-6f4c585bd73fc43fb9e34a70d74b5a50852600ea.tar.gz mruby-6f4c585bd73fc43fb9e34a70d74b5a50852600ea.zip | |
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]`.
Diffstat (limited to 'src/vm.c')
| -rw-r--r-- | src/vm.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -625,7 +625,7 @@ mrb_f_send(mrb_state *mrb, mrb_value self) ci->argc--; } else { /* variable length arguments */ - mrb_ary_shift(mrb, regs[0]); + regs[0] = mrb_ary_subseq(mrb, regs[0], 1, RARRAY_LEN(regs[0]) - 1); } if (MRB_METHOD_CFUNC_P(m)) { |
