summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2010-03-30 19:03:26 +0000
committermarius <marius@FreeBSD.org>2010-03-30 19:03:26 +0000
commitca721ce8830393b7024be0906c4c518d5090e2dc (patch)
tree4974aca4d766322002657be7ce9a8a85142e6eaf /lib
parenteff331f048ccbce2e947b38fb71422c6faf0bc06 (diff)
downloadFreeBSD-src-ca721ce8830393b7024be0906c4c518d5090e2dc.zip
FreeBSD-src-ca721ce8830393b7024be0906c4c518d5090e2dc.tar.gz
MFC: r205394
Ensure that __fpu_ftox() both returns the high bits and res[1] contains the low bits also in the default case. PR: 144900 Obtained from: OpenBSD
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/sparc64/fpu/fpu_implode.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libc/sparc64/fpu/fpu_implode.c b/lib/libc/sparc64/fpu/fpu_implode.c
index 32a0e7c..91e40c1 100644
--- a/lib/libc/sparc64/fpu/fpu_implode.c
+++ b/lib/libc/sparc64/fpu/fpu_implode.c
@@ -248,8 +248,8 @@ __fpu_ftox(fe, fp, res)
sign = fp->fp_sign;
switch (fp->fp_class) {
case FPC_ZERO:
- res[1] = 0;
- return (0);
+ i = 0;
+ goto done;
case FPC_NUM:
/*
@@ -273,15 +273,17 @@ __fpu_ftox(fe, fp, res)
break;
if (sign)
i = -i;
- res[1] = (int)i;
- return (i >> 32);
+ goto done;
default: /* Inf, qNaN, sNaN */
break;
}
/* overflow: replace any inexact exception with invalid */
fe->fe_cx = (fe->fe_cx & ~FSR_NX) | FSR_NV;
- return (0x7fffffffffffffffLL + sign);
+ i = 0x7fffffffffffffffLL + sign;
+done:
+ res[1] = i & 0xffffffff;
+ return (i >> 32);
}
/*
OpenPOWER on IntegriCloud