aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2021-10-12 17:42:05 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2021-10-20 10:17:04 +0000
commitff2746728050429684bf62729df798189cc1d396 (patch)
treee78c9b4cacadbdb2380d8abb8d24dd8b39069cc8
parentd24e5767fe780653d5601b69d981f33e2a62e47e (diff)
downloadgcc-ff2746728050429684bf62729df798189cc1d396.zip
gcc-ff2746728050429684bf62729df798189cc1d396.tar.gz
gcc-ff2746728050429684bf62729df798189cc1d396.tar.bz2
[Ada] Prevent use of an uninitialized AST field with universal integer
gcc/ada/ * exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Guard against equality of an uninitialized RM_Size field.
-rw-r--r--gcc/ada/exp_spark.adb1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/ada/exp_spark.adb b/gcc/ada/exp_spark.adb
index bbfee62..bce745b 100644
--- a/gcc/ada/exp_spark.adb
+++ b/gcc/ada/exp_spark.adb
@@ -451,6 +451,7 @@ package body Exp_SPARK is
Apply_Universal_Integer_Attribute_Checks (N);
if Present (Typ)
+ and then Known_RM_Size (Typ)
and then RM_Size (Typ) = RM_Size (Standard_Long_Long_Integer)
then
-- ??? This should rather be a range check, but this would