summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-19 02:36:32 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-19 02:36:32 (GMT)
commit828998bcd439acc3c0b6c7cfca7635307a650abe (patch)
treea726633383706680bd0d0d11219b8b7eaa884dbd /vm_insnhelper.c
parent3ca0948f68d1055cd980992dcb68deced0f4d704 (diff)
vm_insnhelper.c: should invert unspecified flag
* vm_insnhelper.c (vm_check_keyword): invert unspecified value flag as `checkkeyword` result. fix up r58390. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 33bd4bd..e18235d 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -3029,12 +3029,13 @@ vm_check_keyword(lindex_t bits, lindex_t idx, const VALUE *ep)
if (FIXNUM_P(kw_bits)) {
int b = FIX2INT(kw_bits);
- return (b & (0x01 << idx)) ? Qfalse : Qtrue;
+ if (b & (0x01 << idx)) return Qfalse;
}
else {
VM_ASSERT(RB_TYPE_P(kw_bits, T_HASH));
- return rb_hash_has_key(kw_bits, INT2FIX(idx));
+ if (rb_hash_has_key(kw_bits, INT2FIX(idx))) return Qfalse;
}
+ return Qtrue;
}
static void