summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-01-02 10:06:16 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-01-02 10:41:24 +0900
commit34bc15c86b764e8fdd11d9af8ad3dc401f24b5c4 (patch)
tree378be71f51698704ae6b89081b916670b8e5bd11 /vm_method.c
parent076f24c2278c9718c4e2b23bfb946b960fafa468 (diff)
Check Module#ruby2_keywords arity
It is considered a mistake, because calling this method with no arguments has no effect.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2806
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/vm_method.c b/vm_method.c
index 4504468789..877198cee1 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -1811,6 +1811,7 @@ rb_mod_ruby2_keywords(int argc, VALUE *argv, VALUE module)
int i;
VALUE origin_class = RCLASS_ORIGIN(module);
+ rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
rb_check_frozen(module);
for (i = 0; i < argc; i++) {