summaryrefslogtreecommitdiffhomepage
path: root/include/mruby.h
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 /include/mruby.h
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 'include/mruby.h')
-rw-r--r--include/mruby.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/mruby.h b/include/mruby.h
index 52bcd58bf..8ea59477b 100644
--- a/include/mruby.h
+++ b/include/mruby.h
@@ -889,7 +889,7 @@ MRB_API struct RClass* mrb_define_module_under_id(mrb_state *mrb, struct RClass
* | `H` | {Hash} | {mrb_value} | when `!` follows, the value may be `nil` |
* | `s` | {String} | const char *, {mrb_int} | Receive two arguments; `s!` gives (`NULL`,`0`) for `nil` |
* | `z` | {String} | const char * | `NULL` terminated string; `z!` gives `NULL` for `nil` |
- * | `a` | {Array} | {mrb_value} *, {mrb_int} | Receive two arguments; `a!` gives (`NULL`,`0`) for `nil` |
+ * | `a` | {Array} | const {mrb_value} *, {mrb_int} | Receive two arguments; `a!` gives (`NULL`,`0`) for `nil` |
* | `f` | {Integer}/{Float} | {mrb_float} | |
* | `i` | {Integer}/{Float} | {mrb_int} | |
* | `b` | boolean | {mrb_bool} | |
@@ -897,7 +897,7 @@ MRB_API struct RClass* mrb_define_module_under_id(mrb_state *mrb, struct RClass
* | `d` | data | void *, {mrb_data_type} const | 2nd argument will be used to check data type so it won't be modified; when `!` follows, the value may be `nil` |
* | `I` | inline struct | void * | |
* | `&` | block | {mrb_value} | &! raises exception if no block given. |
- * | `*` | rest arguments | {mrb_value} *, {mrb_int} | Receive the rest of arguments as an array; `*!` avoid copy of the stack. |
+ * | `*` | rest arguments | const {mrb_value} *, {mrb_int} | Receive the rest of arguments as an array; `*!` avoid copy of the stack. |
* | <code>\|</code> | optional | | After this spec following specs would be optional. |
* | `?` | optional given | {mrb_bool} | `TRUE` if preceding argument is given. Used to check optional argument is given. |
* | `:` | keyword args | {mrb_kwargs} const | Get keyword arguments. @see mrb_kwargs |