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_eval.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vm_eval.c') diff --git a/vm_eval.c b/vm_eval.c index 8c7e01edce..a31f4865ed 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -1880,7 +1880,7 @@ uncaught_throw_to_s(VALUE exc) */ static VALUE -rb_f_throw(int argc, VALUE *argv) +rb_f_throw(int argc, VALUE *argv, VALUE _) { VALUE tag, value; @@ -2085,7 +2085,7 @@ local_var_list_add(const struct local_var_list *vars, ID lid) */ static VALUE -rb_f_local_variables(void) +rb_f_local_variables(VALUE _) { struct local_var_list vars; rb_execution_context_t *ec = GET_EC(); @@ -2142,7 +2142,7 @@ rb_f_local_variables(void) static VALUE -rb_f_block_given_p(void) +rb_f_block_given_p(VALUE _) { rb_execution_context_t *ec = GET_EC(); rb_control_frame_t *cfp = ec->cfp; -- cgit v1.2.3