]> Savannah Git Hosting - gnulib.git/commit
ldexp: fix INT_MIN infloop
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 20 Aug 2023 20:23:11 +0000 (13:23 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 20 Aug 2023 20:23:33 +0000 (13:23 -0700)
commit9c7ca2ba1020fadba5939b3792f1021843c1c808
treedc2096d5ac7330a0f01c39bd0bb30f76e03e9f6f
parent5934868bbab8a51b73944a3811de1e7caac88afd
ldexp: fix INT_MIN infloop

* lib/ldexp.c (FUNC): Instead of converting EXP to unsigned,
work on it directly.  This simplifies the code and avoids
an infinite loop when EXP == INT_MIN.
* modules/ldexp, modules/ldexpl: Depend on stdbool.
* tests/test-ldexp.h: Include <limits.h> for INT_MIN.
(test_function): Test for infloop.
ChangeLog
lib/ldexp.c
modules/ldexp
modules/ldexpl
tests/test-ldexp.h