numeric.c: fix smallint op bigint error in bitwise logical operators.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-07-18 08:29:52 +09:00
parent 2d749f5275
commit 0e530dbb63
+9
View File
@@ -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, ^);
}