[COMMITTED] ada: Add missing guards in Selected_Range_Checks
Marc Poulhiès
poulhies@adacore.com
Fri May 26 07:35:38 GMT 2023
From: Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* checks.adb (Selected_Range_Checks): Add guards to protect calls
to Expr_Value on bounds.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/checks.adb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index 0d472964ff5..6525982aef9 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.40.0
More information about the Gcc-patches
mailing list