aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/sem_assocs.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-01-10 11:05:31 +0100
committerTristan Gingold <tgingold@free.fr>2016-01-11 21:26:34 +0100
commit15cf5147f7a97759ac3385d214533d5500b3f9c3 (patch)
treea8fadfb9f535115e30eee9add144a5b3219e6e30 /src/vhdl/sem_assocs.adb
parent4e110147adc921386c8b4e9cf4d1a9a5d20ee4ec (diff)
downloadghdl-15cf5147f7a97759ac3385d214533d5500b3f9c3.tar.gz
ghdl-15cf5147f7a97759ac3385d214533d5500b3f9c3.tar.bz2
ghdl-15cf5147f7a97759ac3385d214533d5500b3f9c3.zip
Set type staticness for a constant declaration and attribute specification.
Fix for issue 10.
Diffstat (limited to 'src/vhdl/sem_assocs.adb')
-rw-r--r--src/vhdl/sem_assocs.adb21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/vhdl/sem_assocs.adb b/src/vhdl/sem_assocs.adb
index 6856097e7..683a8c6f5 100644
--- a/src/vhdl/sem_assocs.adb
+++ b/src/vhdl/sem_assocs.adb
@@ -798,15 +798,18 @@ package body Sem_Assocs is
Set_Whole_Association_Flag (Assoc, True);
case Get_Kind (Atype) is
- when Iir_Kind_Array_Subtype_Definition =>
- Finish_Individual_Assoc_Array_Subtype (Assoc, Atype, 1);
- Set_Actual_Type (Assoc, Atype);
- when Iir_Kind_Array_Type_Definition =>
- Atype := Create_Array_Subtype (Atype, Get_Location (Assoc));
- Set_Index_Constraint_Flag (Atype, True);
- Set_Constraint_State (Atype, Fully_Constrained);
- Set_Actual_Type (Assoc, Atype);
- Finish_Individual_Assoc_Array (Assoc, Assoc, 1);
+ when Iir_Kind_Array_Subtype_Definition
+ | Iir_Kind_Array_Type_Definition =>
+ if Get_Constraint_State (Atype) = Fully_Constrained then
+ Finish_Individual_Assoc_Array_Subtype (Assoc, Atype, 1);
+ Set_Actual_Type (Assoc, Atype);
+ else
+ Atype := Create_Array_Subtype (Atype, Get_Location (Assoc));
+ Set_Index_Constraint_Flag (Atype, True);
+ Set_Constraint_State (Atype, Fully_Constrained);
+ Set_Actual_Type (Assoc, Atype);
+ Finish_Individual_Assoc_Array (Assoc, Assoc, 1);
+ end if;
when Iir_Kind_Record_Type_Definition
| Iir_Kind_Record_Subtype_Definition =>
Finish_Individual_Assoc_Record (Assoc, Atype);