aboutsummaryrefslogtreecommitdiffstats
path: root/sem_types.adb
diff options
context:
space:
mode:
authorgingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7>2006-06-16 18:41:15 +0000
committergingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7>2006-06-16 18:41:15 +0000
commita8db752954f060217f21417bd98077a215fab971 (patch)
treed1a786459661d992376bb583423f790bb1cf8f38 /sem_types.adb
parent549cfe1c332be3633121dfd6d29b98afc24d2650 (diff)
downloadghdl-a8db752954f060217f21417bd98077a215fab971.tar.gz
ghdl-a8db752954f060217f21417bd98077a215fab971.tar.bz2
ghdl-a8db752954f060217f21417bd98077a215fab971.zip
bug fixes
Diffstat (limited to 'sem_types.adb')
-rw-r--r--sem_types.adb19
1 files changed, 12 insertions, 7 deletions
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;