aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt/grt-waves.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-08-05 18:33:44 +0200
committerTristan Gingold <tgingold@free.fr>2020-08-05 18:33:44 +0200
commit7a4c217d9a21bf241c8760750bd10408c7855f35 (patch)
tree0f54feb9ace8851f9d9cf4887fb645360913d665 /src/grt/grt-waves.adb
parent23d162265deadf59a9cf9eabf512923aa25f693e (diff)
downloadghdl-7a4c217d9a21bf241c8760750bd10408c7855f35.tar.gz
ghdl-7a4c217d9a21bf241c8760750bd10408c7855f35.tar.bz2
ghdl-7a4c217d9a21bf241c8760750bd10408c7855f35.zip
grt: adjust previous patch on grt-waves
Write bounds only when the element subtype of the base type is unbounded.
Diffstat (limited to 'src/grt/grt-waves.adb')
-rw-r--r--src/grt/grt-waves.adb26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/grt/grt-waves.adb b/src/grt/grt-waves.adb
index f97f55ac7..db6afb838 100644
--- a/src/grt/grt-waves.adb
+++ b/src/grt/grt-waves.adb
@@ -1298,6 +1298,7 @@ package body Grt.Waves is
To_Ghdl_Rtin_Type_Array_Acc (Rti);
Rng : Ghdl_Range_Ptr;
Index_Type : Ghdl_Rti_Access;
+ El_Type : Ghdl_Rti_Access;
Bounds1 : Address;
begin
Bounds1 := Bounds;
@@ -1306,8 +1307,14 @@ package body Grt.Waves is
Extract_Range (Bounds1, Index_Type, Rng);
Write_Range (Index_Type, Rng);
end loop;
- Bounds1 := Array_Layout_To_Element (Bounds1, Arr.Element);
- Write_Composite_Bounds (Get_Base_Type (Arr.Element), Bounds1);
+ -- Write bounds only if the element subtype of the base type
+ -- is unbounded.
+ El_Type := Arr.Element;
+ if Rtis_Utils.Is_Unbounded (El_Type) then
+ El_Type := Get_Base_Type (El_Type);
+ Bounds1 := Array_Layout_To_Element (Bounds1, El_Type);
+ Write_Composite_Bounds (El_Type, Bounds1);
+ end if;
end;
when Ghdl_Rtik_Type_Record =>
return;
@@ -1316,15 +1323,20 @@ package body Grt.Waves is
Rec : constant Ghdl_Rtin_Type_Record_Acc :=
To_Ghdl_Rtin_Type_Record_Acc (Rti);
El : Ghdl_Rtin_Element_Acc;
- Eltype : Ghdl_Rti_Access;
+ El_Type : Ghdl_Rti_Access;
Bounds1 : Address;
begin
for I in 1 .. Rec.Nbrel loop
El := To_Ghdl_Rtin_Element_Acc (Rec.Elements (I - 1));
- Eltype := Get_Base_Type (El.Eltype);
- Bounds1 := Array_Layout_To_Element
- (Bounds + El.Layout_Off, Eltype);
- Write_Composite_Bounds (Eltype, Bounds1);
+ -- Write bounds only if the element subtype of the base
+ -- type is unbounded.
+ El_Type := El.Eltype;
+ if Rtis_Utils.Is_Unbounded (El_Type) then
+ El_Type := Get_Base_Type (El_Type);
+ Bounds1 := Array_Layout_To_Element
+ (Bounds + El.Layout_Off, El_Type);
+ Write_Composite_Bounds (El_Type, Bounds1);
+ end if;
end loop;
end;
when others =>