aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2015-05-12 20:17:55 +0200
committerTristan Gingold <tgingold@free.fr>2015-05-12 20:17:55 +0200
commita29ce552ab91a5ec0951e92fe1329513cae0253b (patch)
treefb6e0ac5e8c49a5bdbc98885086f9c2650ddc449
parentd9e97c772484b87006e2ac6049b8b6893927c725 (diff)
downloadghdl-a29ce552ab91a5ec0951e92fe1329513cae0253b.tar.gz
ghdl-a29ce552ab91a5ec0951e92fe1329513cae0253b.tar.bz2
ghdl-a29ce552ab91a5ec0951e92fe1329513cae0253b.zip
aliases: avoid crash in case of mismatch between function and procedure.
Fix ticket 55.
-rw-r--r--src/vhdl/sem_decls.adb6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vhdl/sem_decls.adb b/src/vhdl/sem_decls.adb
index a1b39c30d..c7b26ccbe 100644
--- a/src/vhdl/sem_decls.adb
+++ b/src/vhdl/sem_decls.adb
@@ -2056,6 +2056,9 @@ package body Sem_Decls is
-- the signature matches the parameter and result type profile
-- of the subprogram equivalent to the enumeration literal,
-- defined in Section 3.1.1
+ if Get_Return_Type_Mark (Sig) = Null_Iir then
+ return False;
+ end if;
return List = Null_Iir_List
and then Get_Type (N_Entity)
= Get_Type (Get_Return_Type_Mark (Sig));
@@ -2065,6 +2068,9 @@ package body Sem_Decls is
-- a function and the base type of the type mark following
-- the reserved word in the signature is the same as the base
-- type of the return type of the function, [...]
+ if Get_Return_Type_Mark (Sig) = Null_Iir then
+ return False;
+ end if;
if Get_Type (Get_Return_Type_Mark (Sig)) /=
Get_Base_Type (Get_Return_Type (N_Entity))
then