diff options
Diffstat (limited to 'lib/builtins/fixunsxfdi.c')
-rw-r--r-- | lib/builtins/fixunsxfdi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/builtins/fixunsxfdi.c b/lib/builtins/fixunsxfdi.c index 7224d467e7c9..075304e78dc9 100644 --- a/lib/builtins/fixunsxfdi.c +++ b/lib/builtins/fixunsxfdi.c @@ -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); } |