Date: Sun, 19 Jun 2011 17:07:59 +0000 (UTC) From: Steve Kargl <kargl@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r223302 - head/lib/msun/src Message-ID: <201106191707.p5JH7xfO002422@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kargl Date: Sun Jun 19 17:07:58 2011 New Revision: 223302 URL: http://svn.freebsd.org/changeset/base/223302 Log: 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) Modified: head/lib/msun/src/e_rem_pio2.c Modified: head/lib/msun/src/e_rem_pio2.c ============================================================================== --- head/lib/msun/src/e_rem_pio2.c Sun Jun 19 17:02:42 2011 (r223301) +++ head/lib/msun/src/e_rem_pio2.c Sun Jun 19 17:07:58 2011 (r223302) @@ -171,9 +171,8 @@ medium: } /* 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106191707.p5JH7xfO002422>