]> 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)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 26 May 2023 07:29:15 +0000 (09:29 +0200)
gcc/ada/

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

gcc/ada/checks.adb

index 0d472964ff5166777f3a59c3f5e7c4b5386511c1..6525982aef9133354a7f0abd3586ffd974855d55 100644 (file)
@@ -10826,6 +10826,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