In the libm access macros for the double type, z can sometimes

be used uninitialized.  This can lead to spurious exceptions
and bit clobbering.

Submitted by:	bde
Approved by:	das (mentor)
This commit is contained in:
Steve Kargl 2011-06-19 17:07:58 +00:00
parent 1cbcfc538b
commit edfca01f71
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=223302

View File

@ -171,9 +171,8 @@ __ieee754_rem_pio2(double x, double *y)
}
/* set z = scalbn(|x|,ilogb(x)-23) */
GET_LOW_WORD(low,x);
SET_LOW_WORD(z,low);
e0 = (ix>>20)-1046; /* e0 = ilogb(z)-23; */
SET_HIGH_WORD(z, ix - ((int32_t)(e0<<20)));
INSERT_WORDS(z, ix - ((int32_t)(e0<<20)), low);
for(i=0;i<2;i++) {
tx[i] = (double)((int32_t)(z));
z = (z-tx[i])*two24;