aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2020-03-19 11:41:37 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2020-06-11 05:53:55 -0400
commit12ad5b9ccc77adabf81ba798217ac4cdace8ba1f (patch)
tree752f5ef73086f703262d0c63873e8ed1101c05e4
parenteedafec2f2dc0fb189752663de80b95e27ed84b3 (diff)
downloadgcc-12ad5b9ccc77adabf81ba798217ac4cdace8ba1f.zip
gcc-12ad5b9ccc77adabf81ba798217ac4cdace8ba1f.tar.gz
gcc-12ad5b9ccc77adabf81ba798217ac4cdace8ba1f.tar.bz2
[Ada] Fix assertion failure on entry call through unchecked conversion
2020-06-11 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_util.adb (Safe_Unchecked_Type_Conversion): Add missing Is_Type guard before calling Has_Discriminants on Etype.
-rw-r--r--gcc/ada/exp_util.adb11
1 files changed, 4 insertions, 7 deletions
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 5e186ec..471790e 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -12551,13 +12551,10 @@ package body Exp_Util is
elsif Nkind (Pexp) = N_Selected_Component
and then Prefix (Pexp) = Exp
then
- if No (Etype (Pexp)) then
- return True;
- else
- return
- not Has_Discriminants (Etype (Pexp))
- or else Is_Constrained (Etype (Pexp));
- end if;
+ return No (Etype (Pexp))
+ or else not Is_Type (Etype (Pexp))
+ or else not Has_Discriminants (Etype (Pexp))
+ or else Is_Constrained (Etype (Pexp));
end if;
-- Set the output type, this comes from Etype if it is set, otherwise we