about summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-128
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/ldbl-128')
-rw-r--r--sysdeps/ieee754/ldbl-128/s_getpayloadl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdeps/ieee754/ldbl-128/s_getpayloadl.c b/sysdeps/ieee754/ldbl-128/s_getpayloadl.c
index db55a00f66..1fbe704608 100644
--- a/sysdeps/ieee754/ldbl-128/s_getpayloadl.c
+++ b/sysdeps/ieee754/ldbl-128/s_getpayloadl.c
@@ -26,6 +26,9 @@ __getpayloadl (const _Float128 *x)
 {
   uint64_t hx, lx;
   GET_LDOUBLE_WORDS64 (hx, lx, *x);
+  if ((hx & 0x7fff000000000000ULL) != 0x7fff000000000000ULL
+      || ((hx & 0xffffffffffffULL) | lx) == 0)
+    return -1;
   hx &= 0x7fffffffffffULL;
   /* Construct the representation of the return value directly, since
      128-bit integers may not be available.  */