mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* bignum.c (rb_cmpint): FIX2INT may fail on LP64 platforms.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5986849448
commit
5f64ea6c60
2 changed files with 10 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
Fri Mar 27 01:19:50 2009 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* bignum.c (rb_cmpint): FIX2INT may fail on LP64 platforms.
|
||||
|
||||
Thu Mar 26 12:22:06 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/yaml/rubytypes.rb (String#is_binary_data?): TAB would be
|
||||
|
|
7
bignum.c
7
bignum.c
|
@ -57,7 +57,12 @@ rb_cmpint(VALUE val, VALUE a, VALUE b)
|
|||
if (NIL_P(val)) {
|
||||
rb_cmperr(a, b);
|
||||
}
|
||||
if (FIXNUM_P(val)) return FIX2INT(val);
|
||||
if (FIXNUM_P(val)) {
|
||||
long l = FIX2LONG(val);
|
||||
if (l > 0) return 1;
|
||||
if (l < 0) return -1;
|
||||
return 0;
|
||||
}
|
||||
if (TYPE(val) == T_BIGNUM) {
|
||||
if (BIGZEROP(val)) return 0;
|
||||
if (RBIGNUM_SIGN(val)) return 1;
|
||||
|
|
Loading…
Add table
Reference in a new issue