diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-23 15:43:18 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-10-23 15:43:18 +0900 |
| commit | 17247c51f2e713b89d84ea329bae83b71f14a431 (patch) | |
| tree | e69229c79156bb32e1cfa084b1a063e38c65116d /src/array.c | |
| parent | fd38b9217dbb1b4357d8973848babd7ba3f25696 (diff) | |
| parent | f0a64329b1cb8156e0d525d003e5d6ff03b7832f (diff) | |
| download | mruby-17247c51f2e713b89d84ea329bae83b71f14a431.tar.gz mruby-17247c51f2e713b89d84ea329bae83b71f14a431.zip | |
Merge pull request #5099 from dearblue/getargs-array
Prohibit array changes by "a"/"*" specifier of `mrb_get_args()`
Diffstat (limited to 'src/array.c')
| -rw-r--r-- | src/array.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/array.c b/src/array.c index e1e97a1d8..8827cba9e 100644 --- a/src/array.c +++ b/src/array.c @@ -280,7 +280,7 @@ static mrb_value mrb_ary_s_create(mrb_state *mrb, mrb_value klass) { mrb_value ary; - mrb_value *vals; + const mrb_value *vals; mrb_int len; struct RArray *a; @@ -340,7 +340,7 @@ mrb_ary_plus(mrb_state *mrb, mrb_value self) { struct RArray *a1 = mrb_ary_ptr(self); struct RArray *a2; - mrb_value *ptr; + const mrb_value *ptr; mrb_int blen, len1; mrb_get_args(mrb, "a", &ptr, &blen); @@ -615,7 +615,8 @@ static mrb_value mrb_ary_unshift_m(mrb_state *mrb, mrb_value self) { struct RArray *a = mrb_ary_ptr(self); - mrb_value *vals, *ptr; + const mrb_value *vals; + mrb_value *ptr; mrb_int alen, len; mrb_get_args(mrb, "*!", &vals, &alen); @@ -832,7 +833,7 @@ aget_index(mrb_state *mrb, mrb_value index) #endif else { mrb_int i, argc; - mrb_value *argv; + const mrb_value *argv; mrb_get_args(mrb, "i*!", &i, &argv, &argc); return i; |
