diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-09-29 07:56:24 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-09-29 07:56:24 +0200 |
commit | 7efd2f566be98c1052a3276ec0a308aaef72de7a (patch) | |
tree | cd74dc39fdf6e8ea7af4debb4c008505754d7e84 /src/vhdl | |
parent | b72c4e96c337af037575b3399dfee98e476a9846 (diff) | |
download | ghdl-7efd2f566be98c1052a3276ec0a308aaef72de7a.tar.gz ghdl-7efd2f566be98c1052a3276ec0a308aaef72de7a.tar.bz2 ghdl-7efd2f566be98c1052a3276ec0a308aaef72de7a.zip |
vhdl-sem_types: improve error handling on index subtypes. Fix #1473
Diffstat (limited to 'src/vhdl')
-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 d669c170d..3a60b18eb 100644 --- a/src/vhdl/vhdl-sem_types.adb +++ b/src/vhdl/vhdl-sem_types.adb @@ -1051,9 +1051,13 @@ package body Vhdl.Sem_Types is -- Index_Name is a subtype_indication, which can be a type_mark. else -- Avoid errors. - Index_Name := - Build_Simple_Name (Natural_Subtype_Declaration, Index_Type); - Set_Type (Index_Name, Natural_Subtype_Definition); + Index_Name := Create_Iir (Iir_Kind_Integer_Subtype_Definition); + Location_Copy (Index_Name, Index_Type); + Set_Range_Constraint + (Index_Name, + Create_Error_Expr (Index_Type, Integer_Subtype_Definition)); + Set_Parent_Type (Index_Name, Integer_Subtype_Definition); + Set_Type_Staticness (Index_Name, Globally); end if; Set_Nth_Element (Index_List, I, Index_Name); |