From fafda69fce7f6c746719efdb813b7727c2c836b3 Mon Sep 17 00:00:00 2001 From: Martynas Venckus Date: Sat, 2 Jul 2011 18:03:44 +0000 Subject: Rebase on gdtoa-20110428; contains fixes for absurdly long inputs (among other things). Fixes mozilla crasher for the link i was provided with. With the massive local changes to teach that malloc can fail, fixes for the vax, strlcpy, moving things to library namespaces. Tested on all architectures. --- lib/libc/gdtoa/ulp.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lib/libc/gdtoa/ulp.c') diff --git a/lib/libc/gdtoa/ulp.c b/lib/libc/gdtoa/ulp.c index 7810a5c8e64..17e9f862c44 100644 --- a/lib/libc/gdtoa/ulp.c +++ b/lib/libc/gdtoa/ulp.c @@ -34,13 +34,13 @@ THIS SOFTWARE. double ulp #ifdef KR_headers - (x) double x; + (x) U *x; #else - (double x) + (U *x) #endif { Long L; - double a; + U a; L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1; #ifndef Sudden_Underflow @@ -49,22 +49,22 @@ ulp #ifdef IBM L |= Exp_msk1 >> 4; #endif - word0(a) = L; - word1(a) = 0; + word0(&a) = L; + word1(&a) = 0; #ifndef Sudden_Underflow } else { L = -L >> Exp_shift; if (L < Exp_shift) { - word0(a) = 0x80000 >> L; - word1(a) = 0; + word0(&a) = 0x80000 >> L; + word1(&a) = 0; } else { - word0(a) = 0; + word0(&a) = 0; L -= Exp_shift; - word1(a) = L >= 31 ? 1 : 1 << 31 - L; + word1(&a) = L >= 31 ? 1 : 1 << (31 - L); } } #endif - return a; + return dval(&a); } -- cgit v1.2.3