From fb839332f3134c456f6a679f4207620b2dbebf86 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 19 Jan 2018 03:09:24 +0000 Subject: 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 --- vm_insnhelper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vm_insnhelper.c') diff --git a/vm_insnhelper.c b/vm_insnhelper.c index e18235da57..64ac539523 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)); -- cgit v1.2.3