From f0a64329b1cb8156e0d525d003e5d6ff03b7832f Mon Sep 17 00:00:00 2001 From: dearblue Date: Thu, 22 Oct 2020 22:55:35 +0900 Subject: 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). --- mrbgems/mruby-hash-ext/src/hash-ext.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mrbgems/mruby-hash-ext/src') diff --git a/mrbgems/mruby-hash-ext/src/hash-ext.c b/mrbgems/mruby-hash-ext/src/hash-ext.c index 75ebd412b..16e066c73 100644 --- a/mrbgems/mruby-hash-ext/src/hash-ext.c +++ b/mrbgems/mruby-hash-ext/src/hash-ext.c @@ -22,7 +22,8 @@ static mrb_value hash_values_at(mrb_state *mrb, mrb_value hash) { - mrb_value *argv, result; + const mrb_value *argv; + mrb_value result; mrb_int argc, i; int ai; @@ -49,7 +50,8 @@ hash_values_at(mrb_state *mrb, mrb_value hash) static mrb_value hash_slice(mrb_state *mrb, mrb_value hash) { - mrb_value *argv, result; + const mrb_value *argv; + mrb_value result; mrb_int argc, i; mrb_get_args(mrb, "*", &argv, &argc); -- cgit v1.2.3