diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-30 06:54:29 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-30 06:54:29 +0000 |
commit | 6b7e6324b460b6f6bea32dc1d15fb3f994569122 (patch) | |
tree | bd9573d60e871c85e7b7d64c2b6f278483a897e5 /numeric.c | |
parent | 2666cbc045bee377748ef73e47d66751c7a9ecdd (diff) |
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_0_0@49443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -3210,11 +3210,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; |