From a29ce552ab91a5ec0951e92fe1329513cae0253b Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 12 May 2015 20:17:55 +0200 Subject: aliases: avoid crash in case of mismatch between function and procedure. Fix ticket 55. --- src/vhdl/sem_decls.adb | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v1.2.3