]> git.proxmox.com Git - rustc.git/blobdiff - src/compiler-rt/lib/builtins/fixunsxfdi.c
Imported Upstream version 1.6.0+dfsg1
[rustc.git] / src / compiler-rt / lib / builtins / fixunsxfdi.c
index 7224d467e7c9718202718e467c45c6b182d5b4c9..075304e78dc9fb5926de4770bee4c684ed480732 100644 (file)
@@ -38,6 +38,8 @@ __fixunsxfdi(long double a)
     int e = (fb.u.high.s.low & 0x00007FFF) - 16383;
     if (e < 0 || (fb.u.high.s.low & 0x00008000))
         return 0;
+    if ((unsigned)e > sizeof(du_int) * CHAR_BIT)
+        return ~(du_int)0;
     return fb.u.low.all >> (63 - e);
 }