mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-array-ext (ary_rotate_bang): mrb_ary_modify may alter buf address
This commit is contained in:
@@ -307,10 +307,10 @@ ary_rotate_bang(mrb_state *mrb, mrb_value self)
|
||||
|
||||
struct RArray *a = mrb_ary_ptr(self);
|
||||
mrb_int len = ARY_LEN(a);
|
||||
mrb_value *p = ARY_PTR(a);
|
||||
mrb_int idx;
|
||||
|
||||
mrb_ary_modify(mrb, a);
|
||||
mrb_value *p = ARY_PTR(a);
|
||||
if (len == 0 || count == 0) return self;
|
||||
if (count == 1) {
|
||||
mrb_value v = p[0];
|
||||
|
||||
Reference in New Issue
Block a user