diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-17 18:19:41 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-17 18:19:41 +0000 |
commit | 907508b25f91d7a34919839d9fb0f4bf10080b68 (patch) | |
tree | e6d84f200d390effabe23dac78d0448ef09abf42 /numeric.c | |
parent | 66bef9d238a415c9ccfed8a96c0e214fcbe454f3 (diff) | |
download | bundler-907508b25f91d7a34919839d9fb0f4bf10080b68.tar.gz |
Integer#{any|all|no}_bits: Fix coercion. Add specs [#12753]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -3175,6 +3175,7 @@ int_even_p(VALUE num) static VALUE int_allbits_p(VALUE num, VALUE mask) { + mask = rb_to_int(mask); return rb_int_equal(rb_int_and(num, mask), mask); } @@ -3188,6 +3189,7 @@ int_allbits_p(VALUE num, VALUE mask) static VALUE int_anybits_p(VALUE num, VALUE mask) { + mask = rb_to_int(mask); return num_zero_p(rb_int_and(num, mask)) ? Qfalse : Qtrue; } @@ -3201,6 +3203,7 @@ int_anybits_p(VALUE num, VALUE mask) static VALUE int_nobits_p(VALUE num, VALUE mask) { + mask = rb_to_int(mask); return num_zero_p(rb_int_and(num, mask)); } |