From ee1519777bbd4f57463e23b267653f8f37d7afaa Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 30 Jun 2015 02:58:36 +0000 Subject: merge revision(s) 49224,49225,49234,49235: [Backport #10711] * 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/branches/ruby_2_1@51067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index c463732c08..7c9aef1e41 100644 --- a/numeric.c +++ b/numeric.c @@ -3299,11 +3299,12 @@ static int bit_coerce(VALUE *x, VALUE *y, int err) { if (!FIXNUM_P(*y) && !RB_TYPE_P(*y, T_BIGNUM)) { + VALUE orig = *x; do_coerce(x, y, err); if (!FIXNUM_P(*x) && !RB_TYPE_P(*x, T_BIGNUM) && !FIXNUM_P(*y) && !RB_TYPE_P(*y, T_BIGNUM)) { if (!err) return FALSE; - coerce_failed(*x, *y); + coerce_failed(orig, *y); } } return TRUE; -- cgit v1.2.3