summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-16 19:21:32 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-16 19:21:32 +0000
commitbc059aa6d5a5987628b19108b5448915ae3012af (patch)
tree708aa216286a914b093b016cb67a21f069d6803b /class.c
parente9ab3c7ccae115d623339f0382289d66a8621ec9 (diff)
merge revision(s) 56980,56981: [Backport #13004]
extension.rdoc: fix rb_get_kwargs [ci skip] * doc/extension.rdoc: [DOC] optional keyword arguments are defaulted to Qundef. ignored keys are kept in the hash but a new Hash is not created. [ruby-dev:49893] [Bug #13004] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@57346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/class.c b/class.c
index a72f4dcebd..955059d777 100644
--- a/class.c
+++ b/class.c
@@ -2002,7 +2002,7 @@ rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, V
}
}
if (!rest && keyword_hash) {
- if (RHASH_SIZE(keyword_hash) > (unsigned int)j) {
+ if (RHASH_SIZE(keyword_hash) > (unsigned int)(values ? 0 : j)) {
unknown_keyword_error(keyword_hash, table, required+optional);
}
}