diff --git a/src/numeric.c b/src/numeric.c index 2365d7bbd..239492add 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -1382,6 +1382,9 @@ int_and(mrb_state *mrb, mrb_value x) if (mrb_bigint_p(x)) { return mrb_bint_and(mrb, x, y); } + if (mrb_bigint_p(y)) { + return mrb_bint_and(mrb, mrb_as_bint(mrb, x), y); + } #endif bit_op(x, y, and, &); } @@ -1403,6 +1406,9 @@ int_or(mrb_state *mrb, mrb_value x) if (mrb_bigint_p(x)) { return mrb_bint_or(mrb, x, y); } + if (mrb_bigint_p(y)) { + return mrb_bint_or(mrb, mrb_as_bint(mrb, x), y); + } #endif bit_op(x, y, or, |); } @@ -1424,6 +1430,9 @@ int_xor(mrb_state *mrb, mrb_value x) if (mrb_bigint_p(x)) { return mrb_bint_xor(mrb, x, y); } + if (mrb_bigint_p(y)) { + return mrb_bint_xor(mrb, mrb_as_bint(mrb, x), y); + } #endif bit_op(x, y, or, ^); }