]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Add guard to System.Val_Real.Large_Powfive against pathological input
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 17 Dec 2024 19:00:38 +0000 (20:00 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 7 Jan 2025 12:33:33 +0000 (13:33 +0100)
commitc7799a8108e2e53e80d41281e5625b78236d039a
tree851056d5ffdb22986085a8e0341f5803524d2cea
parent0f83183d724d0def1baceef2fa81e7cae92a4ce8
ada: Add guard to System.Val_Real.Large_Powfive against pathological input

There is no need to keep multiplying the result once it saturates to +Inf.

gcc/ada/ChangeLog:

* libgnat/s-powflt.ads (Maxpow_Exact): Minor comment fix.
* libgnat/s-powlfl.ads (Maxpow_Exact): Likewise.
* libgnat/s-powllf.ads (Maxpow_Exact): Likewise.
* libgnat/s-valrea.adb (Large_Powfive) [1 parameter]: Exit the loop
as soon as the result saturates to +Inf.
(Large_Powfive) [2 parameters]: Likewise.
gcc/ada/libgnat/s-powflt.ads
gcc/ada/libgnat/s-powlfl.ads
gcc/ada/libgnat/s-powllf.ads
gcc/ada/libgnat/s-valrea.adb