aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2020-03-19 11:41:37 +0100
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 13:12:12 -0300
commit2e02214f27b3e2c290326430aa7c3cbf78c41941 (patch)
treea3d45fe919d3168e942710d86962dd65345ffb33 /gcc
parent756fded5485d61b83e17ca180b4732ecdb01686d (diff)
downloadgcc-2e02214f27b3e2c290326430aa7c3cbf78c41941.zip
gcc-2e02214f27b3e2c290326430aa7c3cbf78c41941.tar.gz
gcc-2e02214f27b3e2c290326430aa7c3cbf78c41941.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.
Diffstat (limited to 'gcc')
-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