From 0251292d2da4039d4b12ecee81588614bf99b546 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 14 Mar 2023 12:42:53 +0100 Subject: [PATCH] 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. --- gcc/ada/checks.adb | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.47.2