This is visible if you pass a very small number by means of -gnateinn.
2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* inline.adb (Add_Pending_Instantiation): Fix off-by-one error
in the comparison against the maximum number of instantiations.
From-SVN: r274472
+2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
+
+ * inline.adb (Add_Pending_Instantiation): Fix off-by-one error
+ in the comparison against the maximum number of instantiations.
+
2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
* inline.adb (Add_Pending_Instantiation): Use greater-or-equal
-- Here is a defense against a ludicrous number of instantiations
-- caused by a circular set of instantiation attempts.
- if Pending_Instantiations.Last >= Maximum_Instantiations then
+ if Pending_Instantiations.Last + 1 >= Maximum_Instantiations then
Error_Msg_Uint_1 := UI_From_Int (Maximum_Instantiations);
Error_Msg_N ("too many instantiations, exceeds max of^", Inst);
Error_Msg_N ("\limit can be changed using -gnateinn switch", Inst);