summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-io/src/file.c
diff options
context:
space:
mode:
authordearblue <[email protected]>2020-10-22 22:55:35 +0900
committerdearblue <[email protected]>2020-10-22 22:55:35 +0900
commitf0a64329b1cb8156e0d525d003e5d6ff03b7832f (patch)
tree0f7cfdcfb3af7fb51fcc9e4c60aba736ca10d5d1 /mrbgems/mruby-io/src/file.c
parent27492e53a0440aee7c411d5e72b6f092cf85d6a1 (diff)
downloadmruby-f0a64329b1cb8156e0d525d003e5d6ff03b7832f.tar.gz
mruby-f0a64329b1cb8156e0d525d003e5d6ff03b7832f.zip
Prohibit array changes by "a"/"*" specifier of `mrb_get_args()`
The "a"/"*" specifier of the `mrb_get_args()` function will now return `const mrb_value *`. This is because it is difficult for the caller to check if it is an array object and write-barrier if necessary. And it requires calling `mrb_ary_modify()` on the unmodified array object, which is also difficult (this is similar to #5087).
Diffstat (limited to 'mrbgems/mruby-io/src/file.c')
-rw-r--r--mrbgems/mruby-io/src/file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mrbgems/mruby-io/src/file.c b/mrbgems/mruby-io/src/file.c
index d272cab7d..ab325195c 100644
--- a/mrbgems/mruby-io/src/file.c
+++ b/mrbgems/mruby-io/src/file.c
@@ -115,7 +115,7 @@ mrb_file_s_umask(mrb_state *mrb, mrb_value klass)
static mrb_value
mrb_file_s_unlink(mrb_state *mrb, mrb_value obj)
{
- mrb_value *argv;
+ const mrb_value *argv;
mrb_value pathv;
mrb_int argc, i;
char *path;
@@ -533,7 +533,7 @@ static mrb_value
mrb_file_s_chmod(mrb_state *mrb, mrb_value klass) {
mrb_int mode;
mrb_int argc, i;
- mrb_value *filenames;
+ const mrb_value *filenames;
int ai = mrb_gc_arena_save(mrb);
mrb_get_args(mrb, "i*", &mode, &filenames, &argc);