summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-27 10:41:16 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-27 10:41:16 +0000
commited8c211a645cfb0528128306789d73441afadf31 (patch)
tree5c2fbd9fcb1fd3aaa9aecc98263ebd1bd26b888d /class.c
parent3aed194ac3edba9249b34fce09de36fa76326cbc (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_2@57215 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 f142f4472a..13ab80dcd0 100644
--- a/class.c
+++ b/class.c
@@ -1969,7 +1969,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);
}
}