diff options
author | 卜部昌平 <[email protected]> | 2019-08-29 10:57:48 +0900 |
---|---|---|
committer | 卜部昌平 <[email protected]> | 2019-08-29 18:34:09 +0900 |
commit | bfe5d22f89a871b6c1cb556c0115145ade9fe286 () | |
tree | 75a0e1bdac504cae90b09341a54e96f8ccedd772 /include/ruby/intern.h | |
parent | 9b429eb3b15321115d9a217c91c5510fe43777a7 (diff) |
drop-in type check for rb_define_private_method
We can check the function pointer passed to rb_define_private_method like how we do so in rb_define_method. Doing so revealed some problematic usages of rb_obj_dummy. They had to be split according to their arity.
-rw-r--r-- | include/ruby/intern.h | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -1086,6 +1086,47 @@ __attribute__((__unused__,__weakref__("rb_define_protected_method"),__nonnull__( #define rb_define_protected_method_choose_m2(n) rb_define_method_if_constexpr((n)==-2,rb_define_protected_methodm2,rb_define_protected_method_choose_m1(n)) #define rb_define_protected_method_choose_m3(n, f) rb_define_method_if_constexpr(rb_f_notimplement_p(f),rb_define_protected_methodm3,rb_define_protected_method_choose_m2(n)) #define rb_define_protected_method(klass, mid, func, arity) rb_define_protected_method_choose_m3((arity),(func))((klass),(mid),(func),(arity)); #endif #endif |