From a8db752954f060217f21417bd98077a215fab971 Mon Sep 17 00:00:00 2001 From: gingold Date: Fri, 16 Jun 2006 18:41:15 +0000 Subject: bug fixes --- sem_types.adb | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'sem_types.adb') diff --git a/sem_types.adb b/sem_types.adb index bb946a5c0..9b35cc660 100644 --- a/sem_types.adb +++ b/sem_types.adb @@ -997,6 +997,7 @@ package body Sem_Types is is Decl: Iir; Decl_Type : Iir; + Ret_Type : Iir; begin -- LRM93 2.4 -- A resolution function must be a [pure] function; @@ -1023,22 +1024,26 @@ package body Sem_Types is end if; -- LRM93 2.4 -- whose element type is that of the resolved signal. + -- The type of the return value of the function must also be that of + -- the signal. + Ret_Type := Get_Return_Type (Func); if Get_Base_Type (Get_Element_Subtype (Decl_Type)) - /= Get_Base_Type (Atype) + /= Get_Base_Type (Ret_Type) then return False; end if; - -- LRM93 2.4 - -- The type of the return value of the function must also be that of - -- the signal. - if Get_Base_Type (Get_Return_Type (Func)) /= Get_Base_Type (Atype) then + if Atype /= Null_Iir + and then Get_Base_Type (Ret_Type) /= Get_Base_Type (Atype) + then return False; end if; -- LRM93 2.4 -- A resolution function must be a [pure] function; if Flags.Vhdl_Std >= Vhdl_93 and then Get_Pure_Flag (Func) = False then - Error_Msg_Sem - ("resolution " & Disp_Node (Func) & " must be pure", Atype); + if Atype /= Null_Iir then + Error_Msg_Sem + ("resolution " & Disp_Node (Func) & " must be pure", Atype); + end if; return False; end if; return True; -- cgit v1.2.3