From 773fe1d6e97cc3bd80d08d57bf0260a6c1b673e5 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 18 Sep 2006 03:17:06 +0000 Subject: * numeric.c (fix_mul): get rid of shift overflow. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index d6faa16fe..1a7c098e7 100644 --- a/numeric.c +++ b/numeric.c @@ -1989,7 +1989,7 @@ fix_mul(VALUE x, VALUE y) if (FIXABLE(d)) return LONG2FIX(d); return rb_ll2inum(d); #else -# define SQRT_LONG_MAX (1<<((SIZEOF_VALUE*CHAR_BIT-1)/2)) +# define SQRT_LONG_MAX ((SIZEOF_VALUE)1<<((SIZEOF_VALUE*CHAR_BIT-1)/2)) /*tests if N*N would overflow*/ # define FIT_SQRT_LONG(n) (((n)=-SQRT_LONG_MAX)) if (FIT_SQRT_LONG(a) && FIT_SQRT_LONG(b)) -- cgit