summaryrefslogtreecommitdiff
path: root/src/math/scalblnf.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-09-22 17:55:08 -0400
committerRich Felker <dalias@aerifal.cx>2015-03-30 01:15:44 -0400
commit9f93f6d119387f915b8a26f8ab800abee2482373 (patch)
tree48b2738695548c53ff6d2f23cd06c077e75ae5db /src/math/scalblnf.c
parent0a7aca63c0fe68449086074e32dd55bfcb9efdc2 (diff)
downloadmusl-9f93f6d119387f915b8a26f8ab800abee2482373.tar.gz
fix incorrect sequence generation in *rand48 prng functions
patch by Jens Gustedt. this fixes a bug reported by Nadav Har'El. the underlying issue was that a left-shift by 16 bits after promotion of unsigned short to int caused integer overflow. while some compilers define this overflow case as "shifting into the sign bit", doing so doesn't help; the sign bit then gets extended through the upper bits in subsequent arithmetic as unsigned long long. this patch imposes a promotion to unsigned prior to the shift, so that the result is well-defined and matches the specified behavior. (cherry picked from commit 05cef96d9e63a00b319f88343cf9869c8e612843)
Diffstat (limited to 'src/math/scalblnf.c')
0 files changed, 0 insertions, 0 deletions