From d4708cc345e3c0a11c33e1ec197285229d1fd113 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 24 Nov 2018 07:26:51 +0100 Subject: trans-rtis: take into account instances in the count of packages. rtis: check number of packages. --- src/grt/grt-rtis.adb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/grt') diff --git a/src/grt/grt-rtis.adb b/src/grt/grt-rtis.adb index 26d976459..7f4a00ff7 100644 --- a/src/grt/grt-rtis.adb +++ b/src/grt/grt-rtis.adb @@ -24,8 +24,11 @@ -- covered by the GNU Public License. package body Grt.Rtis is + Max_Top_Pkg : Ghdl_Index_Type := 0; + procedure Ghdl_Rti_Add_Package (Pkg : Ghdl_Rti_Access) is begin + pragma Assert (Ghdl_Rti_Top.Nbr_Child < Max_Top_Pkg); Ghdl_Rti_Top.Children (Ghdl_Rti_Top.Nbr_Child) := Pkg; Ghdl_Rti_Top.Nbr_Child := Ghdl_Rti_Top.Nbr_Child + 1; end Ghdl_Rti_Add_Package; @@ -33,10 +36,10 @@ package body Grt.Rtis is procedure Ghdl_Rti_Add_Top (Max_Pkg : Ghdl_Index_Type; Pkgs : Ghdl_Rti_Arr_Acc; Top : Ghdl_Rti_Access; - Instance : Address) - is - pragma Unreferenced (Max_Pkg); + Instance : Address) is begin + Max_Top_Pkg := Max_Pkg; + Ghdl_Rti_Top.Parent := Top; Ghdl_Rti_Top.Children := Pkgs; Ghdl_Rti_Top_Instance := Instance; -- cgit v1.2.3