summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-25 02:16:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-25 02:16:20 +0000
commitbbba02273937d6f2dc3c3028bd1a4263048583bb (patch)
tree6e1ad862112cd4a96e4ec106af9209be9c6e4c86 /class.c
parent6a634322e6cbc9f75ad97029c4b127109dc72662 (diff)
class.c: allow nil keyword_hash
* class.c (rb_extract_keywords): treat nil keyword_hash same as 0, for the case rb_scan_args returns nil if no keyword hash. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/class.c b/class.c
index 25f73ec..2d5657d 100644
--- a/class.c
+++ b/class.c
@@ -1912,6 +1912,8 @@ rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, V
st_delete(rb_hash_tbl_raw(keyword_hash), &key, (val)) : \
st_lookup(rb_hash_tbl_raw(keyword_hash), key, (val)))
+ if (NIL_P(keyword_hash)) keyword_hash = 0;
+
if (optional < 0) {
rest = 1;
optional = -1-optional;