summaryrefslogtreecommitdiff
path: root/include/ruby/intern.h
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-09-14 01:49:33 -0700
committerJeremy Evans <code@jeremyevans.net>2019-09-14 01:49:33 -0700
commitb78a345bd63ff2b52ea0f84754ab0988748a9bd0 (patch)
treed529df7726d15a14d21c7b03a99b332dc93ba7d3 /include/ruby/intern.h
parentb2c29bbab6e88253f497fc3e66a43cb7b4d425b5 (diff)
downloadruby-b78a345bd63ff2b52ea0f84754ab0988748a9bd0.tar.gz
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)
Diffstat (limited to 'include/ruby/intern.h')
-rw-r--r--include/ruby/intern.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index 4fa00d55e6..8a8392825c 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -443,7 +443,9 @@ void rb_provide(const char*);
VALUE rb_f_require(VALUE, VALUE);
VALUE rb_require_safe(VALUE, int);
void rb_obj_call_init(VALUE, int, const VALUE*);
+void rb_obj_call_init_kw(VALUE, int, const VALUE*, int);
VALUE rb_class_new_instance(int, const VALUE*, VALUE);
+VALUE rb_class_new_instance_kw(int, const VALUE*, VALUE, int);
VALUE rb_block_proc(void);
VALUE rb_block_lambda(void);
VALUE rb_proc_new(rb_block_call_func_t, VALUE);
@@ -456,7 +458,9 @@ VALUE rb_binding_new(void);
VALUE rb_obj_method(VALUE, VALUE);
VALUE rb_obj_is_method(VALUE);
VALUE rb_method_call(int, const VALUE*, VALUE);
+VALUE rb_method_call_kw(int, const VALUE*, VALUE, int);
VALUE rb_method_call_with_block(int, const VALUE *, VALUE, VALUE);
+VALUE rb_method_call_with_block_kw(int, const VALUE *, VALUE, VALUE, int);
int rb_mod_method_arity(VALUE, ID);
int rb_obj_method_arity(VALUE, ID);
VALUE rb_protect(VALUE (*)(VALUE), VALUE, int*);