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. --- vm_method.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vm_method.c') diff --git a/vm_method.c b/vm_method.c index 154cd8e601..cd91cad802 100644 --- a/vm_method.c +++ b/vm_method.c @@ -1802,7 +1802,7 @@ rb_mod_private_method(int argc, VALUE *argv, VALUE obj) */ static VALUE -top_public(int argc, VALUE *argv) +top_public(int argc, VALUE *argv, VALUE _) { return rb_mod_public(argc, argv, rb_cObject); } @@ -1820,7 +1820,7 @@ top_public(int argc, VALUE *argv) * String arguments are converted to symbols. */ static VALUE -top_private(int argc, VALUE *argv) +top_private(int argc, VALUE *argv, VALUE _) { return rb_mod_private(argc, argv, rb_cObject); } -- cgit v1.2.3