mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): since methods
can be overridden, so should not make an assumption on the type of results. [ruby-core:42969][Bug #6093] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ce2211bf04
commit
f5482e4c38
3 changed files with 14 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
Mon Feb 27 17:03:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): since methods
|
||||
can be overridden, so should not make an assumption on the type
|
||||
of results. [ruby-core:42969][Bug #6093]
|
||||
|
||||
Mon Feb 27 10:54:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/mkmf.rb (try_cppflags, try_cflags, try_ldflags): replace the
|
||||
|
|
|
@ -209,7 +209,7 @@ again:
|
|||
if (prec < 0) goto unable_to_coerce_without_prec;
|
||||
if (prec > DBL_DIG+1)goto SomeOneMayDoIt;
|
||||
v = rb_funcall(v, id_to_r, 0);
|
||||
/* fall through */
|
||||
goto again;
|
||||
case T_RATIONAL:
|
||||
if (prec < 0) goto unable_to_coerce_without_prec;
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require_relative "testbase"
|
||||
require_relative "../ruby/envutil"
|
||||
|
||||
require 'thread'
|
||||
|
||||
|
@ -1303,4 +1304,10 @@ class TestBigDecimal < Test::Unit::TestCase
|
|||
assert_equal(1, y)
|
||||
assert_kind_of(c, y)
|
||||
end
|
||||
|
||||
def test_to_d
|
||||
bug6093 = '[ruby-core:42969]'
|
||||
code = "exit(BigDecimal.new('10.0') == 10.0.to_d)"
|
||||
assert_ruby_status(%w[-rbigdecimal -rbigdecimal/util -rmathn -], code, bug6093)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue