diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-01 20:56:50 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-01 20:56:50 +0000 |
commit | bd52bed97be25e8f3344033ac01416349ec8be67 (patch) | |
tree | c5c4f0a5dde4d00d9878819587c70dd0c3eb65ea /ext/date | |
parent | c8cde4e2be5a1cdc151e436d6d2189314902d748 (diff) | |
download | ruby-bd52bed97be25e8f3344033ac01416349ec8be67.tar.gz |
* ext/date/date_core.c: [ruby-core:46058].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/date')
-rw-r--r-- | ext/date/date_core.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/date/date_core.c b/ext/date/date_core.c index 8096fd7bfb..e44c6474c4 100644 --- a/ext/date/date_core.c +++ b/ext/date/date_core.c @@ -980,8 +980,14 @@ safe_mul_p(VALUE x, long m) if (!FIXNUM_P(x)) return 0; ix = FIX2LONG(x); - if (ix >= (FIXNUM_MAX / m)) - return 0; + if (ix < 0) { + if (ix <= (FIXNUM_MIN / m)) + return 0; + } + else { + if (ix >= (FIXNUM_MAX / m)) + return 0; + } return 1; } |