From bd52bed97be25e8f3344033ac01416349ec8be67 Mon Sep 17 00:00:00 2001 From: tadf Date: Sun, 1 Jul 2012 20:56:50 +0000 Subject: * 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 --- ext/date/date_core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ext/date') 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; } -- cgit v1.2.3