summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-12 09:56:14 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-12 09:56:14 +0000
commit34289fff0fe6fed9bcc23fa27a650a729f54b64b (patch)
treeef0b5c975382a1b7908a8e9ee6779aca717789aa /numeric.c
parent77f3125567adc54b8a5534c2c1ded5a19100e8d5 (diff)
numeric.c: correct error message when coerce fails
* numeric.c (bit_coerce): use original value for error message [ruby-core:67405] [Bug #10711] * test/ruby/test_numeric.rb (test_coerce): check error message git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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;