From: Eric Botcazou Date: Tue, 14 Mar 2023 11:42:53 +0000 (+0100) Subject: ada: Add missing guards in Selected_Range_Checks X-Git-Tag: basepoints/gcc-15~8884 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0251292d2da4039d4b12ecee81588614bf99b546;p=thirdparty%2Fgcc.git ada: Add missing guards in Selected_Range_Checks gcc/ada/ * checks.adb (Selected_Range_Checks): Add guards to protect calls to Expr_Value on bounds. --- diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 0d472964ff51..6525982aef91 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -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