[Ada] Fix 0-sized secondary stack allocations
authorMarc Poulhiès <poulhies@adacore.com>
Thu, 30 Jun 2022 07:50:02 +0000 (09:50 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 12 Jul 2022 12:24:15 +0000 (12:24 +0000)
commit6e3c2ee1d17a45eaf2095d4f64462da0993b881e
treedbad9d6c0a00c7f40aa0c98ce1993a0c4b7eba39
parent33338e7289288404de79cb57dd1003a7552fb3d4
[Ada] Fix 0-sized secondary stack allocations

The Has_Enough_Free_Memory was not correctly reporting a completely full
chunk in the case of a 0-sized allocation.

gcc/ada/

* libgnat/s-secsta.adb (Has_Enough_Free_Memory): Check for full
chunk before computing the available size.
gcc/ada/libgnat/s-secsta.adb