diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-08-04 19:17:20 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-08-04 19:17:20 +0200 |
commit | 73d3e2bd68995aa55c93fbbaa5d008ec9ce2abfe (patch) | |
tree | 4058c116ab868e7e7ab4b87135c3d2c584122dca /src/grt/grt-rtis_addr.adb | |
parent | c969350770eac2f54cf86284c5d3fd95fdcd762c (diff) | |
download | ghdl-73d3e2bd68995aa55c93fbbaa5d008ec9ce2abfe.tar.gz ghdl-73d3e2bd68995aa55c93fbbaa5d008ec9ce2abfe.tar.bz2 ghdl-73d3e2bd68995aa55c93fbbaa5d008ec9ce2abfe.zip |
grt: handle more unbounded types in disp_rti and ghw.
Fix #1131
Diffstat (limited to 'src/grt/grt-rtis_addr.adb')
-rw-r--r-- | src/grt/grt-rtis_addr.adb | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/src/grt/grt-rtis_addr.adb b/src/grt/grt-rtis_addr.adb index e02aa8e89..c3273917c 100644 --- a/src/grt/grt-rtis_addr.adb +++ b/src/grt/grt-rtis_addr.adb @@ -323,20 +323,37 @@ package body Grt.Rtis_Addr is end loop; end Bound_To_Range; - function Get_Base_Type (Atype : Ghdl_Rti_Access) return Ghdl_Rti_Access is + function Get_Base_Type (Atype : Ghdl_Rti_Access) return Ghdl_Rti_Access + is + Res : Ghdl_Rti_Access; begin - case Atype.Kind is - when Ghdl_Rtik_Subtype_Scalar => - return To_Ghdl_Rtin_Subtype_Scalar_Acc (Atype).Basetype; - when Ghdl_Rtik_Subtype_Array => - return To_Ghdl_Rtin_Subtype_Composite_Acc (Atype).Basetype; - when Ghdl_Rtik_Type_E8 - | Ghdl_Rtik_Type_E32 - | Ghdl_Rtik_Type_B1 => - return Atype; - when others => - Internal_Error ("rtis_addr.get_base_type"); - end case; + Res := Atype; + loop + case Res.Kind is + when Ghdl_Rtik_Type_E8 + | Ghdl_Rtik_Type_E32 + | Ghdl_Rtik_Type_B1 + | Ghdl_Rtik_Type_I32 + | Ghdl_Rtik_Type_I64 + | Ghdl_Rtik_Type_P32 + | Ghdl_Rtik_Type_P64 + | Ghdl_Rtik_Type_F64 => + return Res; + when Ghdl_Rtik_Subtype_Scalar => + Res := To_Ghdl_Rtin_Subtype_Scalar_Acc (Res).Basetype; + when Ghdl_Rtik_Type_Array + | Ghdl_Rtik_Type_Record + | Ghdl_Rtik_Type_Unbounded_Record => + return Res; + when Ghdl_Rtik_Subtype_Array + | Ghdl_Rtik_Subtype_Unbounded_Array + | Ghdl_Rtik_Subtype_Record + | Ghdl_Rtik_Subtype_Unbounded_Record => + Res := To_Ghdl_Rtin_Subtype_Composite_Acc (Res).Basetype; + when others => + Internal_Error ("rtis_addr.get_base_type"); + end case; + end loop; end Get_Base_Type; function Rti_Complex_Type (Atype : Ghdl_Rti_Access) return Boolean is |