From 7bcfd9189a6a0b2ad58fed988faaf795a4987893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Wed, 28 Aug 2019 18:19:11 +0900 Subject: drop-in type check for rb_define_global_function We can check the function pointer passed to rb_define_global_function like we do so in rb_define_method. It turns out that almost anybody is misunderstanding the API. --- vm_backtrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vm_backtrace.c') diff --git a/vm_backtrace.c b/vm_backtrace.c index ef644052a5..44a4ac0784 100644 --- a/vm_backtrace.c +++ b/vm_backtrace.c @@ -1007,7 +1007,7 @@ rb_vm_thread_backtrace_locations(int argc, const VALUE *argv, VALUE thval) */ static VALUE -rb_f_caller(int argc, VALUE *argv) +rb_f_caller(int argc, VALUE *argv, VALUE _) { return ec_backtrace_to_ary(GET_EC(), argc, argv, 1, 1, 1); } @@ -1035,7 +1035,7 @@ rb_f_caller(int argc, VALUE *argv) * entries within the specified range. */ static VALUE -rb_f_caller_locations(int argc, VALUE *argv) +rb_f_caller_locations(int argc, VALUE *argv, VALUE _) { return ec_backtrace_to_ary(GET_EC(), argc, argv, 1, 1, 0); } -- cgit v1.2.1