From bfe5d22f89a871b6c1cb556c0115145ade9fe286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Thu, 29 Aug 2019 10:57:48 +0900 Subject: 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. --- class.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'class.c') diff --git a/class.c b/class.c index 809bfd8c9d..0714f54e16 100644 --- a/class.c +++ b/class.c @@ -1561,6 +1561,9 @@ rb_define_protected_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS) rb_add_method_cfunc(klass, rb_intern(name), func, argc, METHOD_VISI_PROTECTED); } +#ifdef rb_define_private_method +#undef rb_define_private_method +#endif void rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc) { -- cgit v1.2.3