]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Add missing guards in Selected_Range_Checks
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 14 Mar 2023 11:42:53 +0000 (12:42 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Wed, 27 Sep 2023 08:16:25 +0000 (10:16 +0200)
gcc/ada/

* checks.adb (Selected_Range_Checks): Add guards to protect calls
to Expr_Value on bounds.

gcc/ada/checks.adb

index e21f3065cb15d8fafb062f6db9c998c11dcfa9bc..ca6fe42d967ae5ac47dd958b5a69f959b04d1bfb 100644 (file)
@@ -10815,6 +10815,8 @@ package body Checks is
 
                if not Check_Added
                  and then Is_Fixed_Lower_Bound_Index_Subtype (T_Typ)
+                 and then Known_LB
+                 and then Known_T_LB
                  and then Expr_Value (LB) /= Expr_Value (T_LB)
                then
                   Add_Check