aboutsummaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/numeric.c b/numeric.c
index 5bbdbfb785..7458797866 100644
--- a/numeric.c
+++ b/numeric.c
@@ -3426,10 +3426,11 @@ static int
bit_coerce(VALUE *x, VALUE *y)
{
if (!FIXNUM_P(*y) && !RB_TYPE_P(*y, T_BIGNUM)) {
+ VALUE orig = *x;
do_coerce(x, y, TRUE);
if (!FIXNUM_P(*x) && !RB_TYPE_P(*x, T_BIGNUM)
&& !FIXNUM_P(*y) && !RB_TYPE_P(*y, T_BIGNUM)) {
- coerce_failed(*x, *y);
+ coerce_failed(orig, *y);
}
}
return TRUE;