diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-09-05 10:36:30 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-09-05 10:36:30 +0000 |
commit | c392960862797ed81b3da39422614e763577b337 (patch) | |
tree | 73c95d3fe7bc6ca0ad7e98fceed010fb1f9b048b | |
parent | 4e895d89500fe926a7e0e992670b1e2fabb25e10 (diff) | |
download | mpfr-c392960862797ed81b3da39422614e763577b337.tar.gz |
[src/get_ld.c] when denorm=16, a 32-bit shift on an unsigned int is undefined
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13136 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | src/get_ld.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/get_ld.c b/src/get_ld.c index cb0e0c63c..1717d33c9 100644 --- a/src/get_ld.c +++ b/src/get_ld.c @@ -111,8 +111,9 @@ mpfr_get_ld (mpfr_srcptr x, mpfr_rnd_t rnd_mode) else if (denorm < 32) { ld.s.manl = (tmpmant[1] >> (denorm - 16)) - | ((unsigned int) tmpmant[2] << (32 - denorm)) - | ((unsigned int) tmpmant[3] << (48 - denorm)); + | ((unsigned int) tmpmant[2] << (32 - denorm)); + if (denorm < 16) + ld.s.manl |= ((unsigned int) tmpmant[3] << (48 - denorm)); ld.s.manh = tmpmant[3] >> (denorm - 16); } else if (denorm < 48) |