diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-08-25 07:33:40 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-08-25 07:33:40 +0200 |
commit | 46ffacc65b3f284ec7ceac9fead14b05eef80f47 (patch) | |
tree | e65b7bbf07b1de79e1a5da3e27d3cc45a052dd9f /src | |
parent | a5ff9b623532ef2a15ca0a6ba315f2f463142490 (diff) | |
download | ghdl-46ffacc65b3f284ec7ceac9fead14b05eef80f47.tar.gz ghdl-46ffacc65b3f284ec7ceac9fead14b05eef80f47.tar.bz2 ghdl-46ffacc65b3f284ec7ceac9fead14b05eef80f47.zip |
vhdl-sem_types.adb: refine conditions for resolution functions.
Do not consider that functions with unbounded elements can be a
resolution function.
For #1844
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/vhdl-sem_types.adb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/vhdl/vhdl-sem_types.adb b/src/vhdl/vhdl-sem_types.adb index 81a11e861..848cea916 100644 --- a/src/vhdl/vhdl-sem_types.adb +++ b/src/vhdl/vhdl-sem_types.adb @@ -1314,6 +1314,7 @@ package body Vhdl.Sem_Types is Decl: Iir; Decl_Type : Iir; Ret_Type : Iir; + El_Type : Iir; begin -- LRM93 2.4 -- A resolution function must be a [pure] function; @@ -1343,9 +1344,8 @@ package body Vhdl.Sem_Types is -- 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 (Ret_Type) - then + El_Type := Get_Element_Subtype (Decl_Type); + if Get_Base_Type (El_Type) /= Get_Base_Type (Ret_Type) then return False; end if; if Atype /= Null_Iir @@ -1353,6 +1353,10 @@ package body Vhdl.Sem_Types is then return False; end if; + if not Is_Fully_Constrained_Type (El_Type) then + -- FIXME: not yet handled: unbounded element. + return False; + end if; -- LRM93 2.4 -- A resolution function must be a [pure] function; if not Flags.Flag_Relaxed_Rules and then not Get_Pure_Flag (Func) then |