diff options
| author | dearblue <[email protected]> | 2021-08-13 15:04:19 +0900 |
|---|---|---|
| committer | dearblue <[email protected]> | 2021-08-13 15:04:19 +0900 |
| commit | 01da5e13920989b6c7ab97900659f570bdcb78f2 (patch) | |
| tree | 5e0b9eea1c7ab20c8e018b54dce9f6f4af6ff36e /include/mruby.h | |
| parent | 9e74aad43c8a7652c3cc0ffdc282c66ea866999b (diff) | |
| download | mruby-01da5e13920989b6c7ab97900659f570bdcb78f2.tar.gz mruby-01da5e13920989b6c7ab97900659f570bdcb78f2.zip | |
Check the class with `I` specifier of `mrb_get_args()`
Previously, the `I` specifier only checked if the object was `MRB_TT_ISTRUCT`.
So it was at risk of getting pointers to different C structs if multiple classes were to use the `MRB_TT_ISTRUCT` instance.
Change this behavior and change the C argument corresponding to the `I` specifier to `(void *, struct RClass)`.
This change is not compatible with the previous mruby.
Please note that if the user uses the previous specifications, `SIGSEGV` may occur or the machine stack may be destroyed.
resolve #5527
Diffstat (limited to 'include/mruby.h')
| -rw-r--r-- | include/mruby.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/mruby.h b/include/mruby.h index 77f862356..4d2b65254 100644 --- a/include/mruby.h +++ b/include/mruby.h @@ -901,7 +901,7 @@ MRB_API struct RClass* mrb_define_module_under_id(mrb_state *mrb, struct RClass * | `b` | boolean | {mrb_bool} | | * | `n` | {String}/{Symbol} | {mrb_sym} | | * | `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 * | | + * | `I` | inline struct | void *, struct RClass | | * | `&` | block | {mrb_value} | &! raises exception if no block given. | * | `*` | 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. | |
