diff options
Diffstat (limited to 'gcc/ada/restrict.adb')
-rw-r--r-- | gcc/ada/restrict.adb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb index 3027ffa..ff44e6f 100644 --- a/gcc/ada/restrict.adb +++ b/gcc/ada/restrict.adb @@ -427,6 +427,7 @@ package body Restrict is if VV < 0 then Info.Unknown (R) := True; Info.Count (R) := 1; + else Info.Count (R) := VV; end if; @@ -442,10 +443,11 @@ package body Restrict is if VV < 0 then Info.Unknown (R) := True; - -- If checked by maximization, do maximization + -- If checked by maximization, nothing to do because the + -- check is per-object. elsif R in Checked_Max_Parameter_Restrictions then - Info.Count (R) := Integer'Max (Info.Count (R), VV); + null; -- If checked by adding, do add, checking for overflow @@ -554,6 +556,13 @@ package body Restrict is Msg_Issued := True; Restriction_Msg (R, N); end if; + + -- For Max_Entries and the like, do not carry forward the violation + -- count because it does not affect later declarations. + + if R in Checked_Max_Parameter_Restrictions then + Restrictions.Count (R) := 0; + end if; end Check_Restriction; ------------------------------------- |