From b78a345bd63ff2b52ea0f84754ab0988748a9bd0 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Sat, 14 Sep 2019 01:49:33 -0700 Subject: Only set RB_PASS_CALLED_KEYWORDS in C functions called directly from Ruby It is not safe to set this in C functions that can be called from other C functions, as in the non argument-delegation case, you can end up calling a Ruby method with a flag indicating keywords are set without passing keywords. Introduce some new *_kw functions that take a kw_splat flag and use these functions to set RB_PASS_CALLED_KEYWORDS in places where we know we are delegating methods (e.g. Class#new, Method#call) --- include/ruby/ruby.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/ruby/ruby.h') diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 1b396f4c19..b60afde04c 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -1901,6 +1901,7 @@ VALUE rb_funcall_with_block(VALUE, ID, int, const VALUE*, VALUE); VALUE rb_funcall_with_block_kw(VALUE, ID, int, const VALUE*, VALUE, int); int rb_scan_args(int, const VALUE*, const char*, ...); VALUE rb_call_super(int, const VALUE*); +VALUE rb_call_super_kw(int, const VALUE*, int); VALUE rb_current_receiver(void); int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *); VALUE rb_extract_keywords(VALUE *orighash); -- cgit v1.2.3