aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-10-24 18:40:49 +0200
committerTristan Gingold <tgingold@free.fr>2018-10-24 18:40:49 +0200
commit278677dd1bb3c9fa2b7f9950d13afaf04ef4059b (patch)
tree20deb05acf7514adc2aa27668e7f102f447ee859 /src/vhdl
parent3e3072fa63981eb3535a9c3ba4b0f5a562cacd16 (diff)
downloadghdl-278677dd1bb3c9fa2b7f9950d13afaf04ef4059b.tar.gz
ghdl-278677dd1bb3c9fa2b7f9950d13afaf04ef4059b.tar.bz2
ghdl-278677dd1bb3c9fa2b7f9950d13afaf04ef4059b.zip
trans-rtis: fix uninitialized variable.
Diffstat (limited to 'src/vhdl')
-rw-r--r--src/vhdl/translate/trans-rtis.adb11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/vhdl/translate/trans-rtis.adb b/src/vhdl/translate/trans-rtis.adb
index 0ab7a1bf9..00ee0a0ee 100644
--- a/src/vhdl/translate/trans-rtis.adb
+++ b/src/vhdl/translate/trans-rtis.adb
@@ -1353,6 +1353,14 @@ package body Trans.Rtis is
case Get_Kind (Atype) is
when Iir_Kind_Access_Type_Definition =>
+ -- Don't bother with designated type. This at least avoid
+ -- loops.
+ Base_Type := Null_Iir;
+ -- Set rti_max_depth before generating RTI for designated type,
+ -- as the designated type can reference this access type (and
+ -- therefore read the max depth).
+ Info.B.Rti_Max_Depth := 0;
+
declare
Mark : Id_Mark_Type;
begin
@@ -1366,9 +1374,6 @@ package body Trans.Rtis is
else
Kind := Ghdl_Rtik_Type_Access;
end if;
- -- Don't bother with designated type. This at least avoid
- -- loops.
- Base_Type := Null_Iir;
when Iir_Kind_File_Type_Definition =>
Base_Type := Get_Type (Get_File_Type_Mark (Atype));
Base := Generate_Type_Definition (Base_Type);