From a08df05021a3513d0382b95197e020e44da45a4d Mon Sep 17 00:00:00 2001 From: shyouhei Date: Thu, 9 Mar 2017 02:31:23 +0000 Subject: revert RB_FIXABLE related changesets [Bug #13288][Bug #13293][Bug #13294] This commit is auto-generated using following command: svn diff -r57807:57788 include internal.h bignum.c numeric.c compile.c insns.def object.c sprintf.c | patch -p0 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- object.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'object.c') diff --git a/object.c b/object.c index 21779401fb..9ec96687e9 100644 --- a/object.c +++ b/object.c @@ -2747,8 +2747,11 @@ rb_convert_to_integer(VALUE val, int base) VALUE tmp; if (RB_FLOAT_TYPE_P(val)) { + double f; if (base != 0) goto arg_error; - return rb_dbl2ival(RFLOAT_VALUE(val)); + f = RFLOAT_VALUE(val); + if (FIXABLE(f)) return LONG2FIX((long)f); + return rb_dbl2big(f); } else if (RB_INTEGER_TYPE_P(val)) { if (base != 0) goto arg_error; -- cgit v1.2.3