]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Apply range checks to preanalyzed aggregate expressions
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 26 Jan 2023 14:56:04 +0000 (15:56 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 16 May 2023 08:30:58 +0000 (10:30 +0200)
When preanalyzing expressions in GNATprove mode, e.g. Pre/Post
contracts, we apply checks, because these expressions will never
be expanded. This didn't happen for aggregate expressions, most
likely because of an oversight.

gcc/ada/

* sem_util.adb (Aggregate_Constraint_Checks): Don't exit early
when preanalysing in GNATprove mode. Now the condition is
consistent with other similar conditions in other code.

gcc/ada/sem_util.adb

index ad74de6b6f62403cd5265654760b985cfc425817..38dc654f7beeaa0455aa663d9d31e13af0ae432c 100644 (file)
@@ -477,7 +477,7 @@ package body Sem_Util is
       --  this breaks the name resolution mechanism for generic instances.
 
       if not Expander_Active
-        and (Inside_A_Generic or not Full_Analysis or not GNATprove_Mode)
+        and not (GNATprove_Mode and not Inside_A_Generic)
       then
          return;
       end if;