summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-19 03:09:24 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-19 03:09:24 (GMT)
commitfb839332f3134c456f6a679f4207620b2dbebf86 (patch)
tree52fc7f88bf74e5f95de318d533a0c40ee72edfc7 /vm_insnhelper.c
parent828998bcd439acc3c0b6c7cfca7635307a650abe (diff)
vm_insnhelper.c: fix many keyword arguments
* vm_insnhelper.c (vm_check_keyword): if the index exceeds the width of unspecified bits, that argument is specified. `unspecified_bits` still be a fixnum if the actual arguments do not exceed the limit, regardless the formal parameters size. [ruby-core:84921] [Bug #14373] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index e18235d..64ac539 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -3029,7 +3029,8 @@ vm_check_keyword(lindex_t bits, lindex_t idx, const VALUE *ep)
if (FIXNUM_P(kw_bits)) {
int b = FIX2INT(kw_bits);
- if (b & (0x01 << idx)) return Qfalse;
+ if ((idx < KW_SPECIFIED_BITS_MAX) && (b & (0x01 << idx)))
+ return Qfalse;
}
else {
VM_ASSERT(RB_TYPE_P(kw_bits, T_HASH));