[前][次][番号順一覧][スレッド一覧]

ruby-changes:45732

From: naruse <ko1@a...>
Date: Wed, 8 Mar 2017 02:51:40 +0900 (JST)
Subject: [ruby-changes:45732] naruse:r57805 (trunk): Revert r57803 "Avoid to cast the argument"

naruse	2017-03-08 02:51:35 +0900 (Wed, 08 Mar 2017)

  New Revision: 57805

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57805

  Log:
    Revert r57803 "Avoid to cast the argument"
    
    __builtin_add_overflow doesn't support double.

  Modified files:
    trunk/include/ruby/ruby.h
Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 57804)
+++ include/ruby/ruby.h	(revision 57805)
@@ -360,7 +360,7 @@ rb_fix2ulong(VALUE x) https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L360
 #define RB_POSFIXABLE(f) ((f) < RUBY_FIXNUM_MAX+1)
 #define RB_NEGFIXABLE(f) ((f) >= RUBY_FIXNUM_MIN)
 #if defined HAVE_BUILTIN___BUILTIN_ADD_OVERFLOW
-# define RB_FIXABLE(f) ({SIGNED_VALUE c; !__builtin_add_overflow((f), (f), &c);})
+# define RB_FIXABLE(f) ({SIGNED_VALUE a=(f),c; !__builtin_add_overflow(a, a, &c);})
 #else
 # define RB_FIXABLE(f) (RB_POSFIXABLE(f) && RB_NEGFIXABLE(f))
 #endif

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]