diff --git a/ChangeLog b/ChangeLog index f874fc5610..2335ae6bff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Sep 18 12:16:48 2006 Nobuyoshi Nakada + + * numeric.c (fix_mul): get rid of shift overflow. + Mon Sep 18 10:47:49 2006 Yukihiro Matsumoto * dir.c (dir_s_glob): remove unused variable. diff --git a/numeric.c b/numeric.c index d6faa16fee..1a7c098e7e 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))