aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/sem_expr.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-12-09 17:26:08 +0100
committerTristan Gingold <tgingold@free.fr>2018-12-09 17:26:08 +0100
commitf7ee7d70756e4dd2ebcaeb6a0d8292a73678956c (patch)
tree6ea006fcf43fc2c3c106106d07df91c4d5ee358f /src/vhdl/sem_expr.adb
parenta7e43bb203602e382d07a72cfd16dcae386d99a7 (diff)
downloadghdl-f7ee7d70756e4dd2ebcaeb6a0d8292a73678956c.tar.gz
ghdl-f7ee7d70756e4dd2ebcaeb6a0d8292a73678956c.tar.bz2
ghdl-f7ee7d70756e4dd2ebcaeb6a0d8292a73678956c.zip
record ownership of record element constraints.
Diffstat (limited to 'src/vhdl/sem_expr.adb')
-rw-r--r--src/vhdl/sem_expr.adb12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/vhdl/sem_expr.adb b/src/vhdl/sem_expr.adb
index 770b295d3..78d62c57c 100644
--- a/src/vhdl/sem_expr.adb
+++ b/src/vhdl/sem_expr.adb
@@ -3170,6 +3170,7 @@ package body Sem_Expr is
Rec_El_List : Iir_Flist;
Rec_El : Iir;
Rec_El_Type : Iir;
+ New_Rec_El : Iir;
Constraint : Iir_Constraint;
Composite_Found : Boolean;
Staticness : Iir_Staticness;
@@ -3188,7 +3189,16 @@ package body Sem_Expr is
and then not Is_Fully_Constrained_Type (Rec_El_Type)
then
Rec_El_Type := El_Type;
- Set_Type (Rec_El, Rec_El_Type);
+ New_Rec_El :=
+ Create_Iir (Iir_Kind_Record_Element_Constraint);
+ Location_Copy (New_Rec_El, Rec_El);
+ Set_Parent (New_Rec_El, Rec_Type);
+ Set_Identifier (New_Rec_El, Get_Identifier (Rec_El));
+ pragma Assert (I = Natural (Get_Element_Position (Rec_El)));
+ Set_Element_Position (New_Rec_El, Iir_Index32 (I));
+ Set_Nth_Element (Rec_El_List, I, New_Rec_El);
+ Set_Type (New_Rec_El, Rec_El_Type);
+ Append_Owned_Element_Constraint (Rec_Type, New_Rec_El);
end if;
Staticness := Min (Staticness,
Get_Type_Staticness (Rec_El_Type));