From af8bab4427fe36bef335724501c7410a7268bac5 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 4 Jan 2019 10:59:29 +0100 Subject: grt/rtis: fix use of bounds for unbounded subelements. --- src/grt/grt-disp_rti.adb | 5 ++++- src/grt/grt-rtis_utils.adb | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src/grt') diff --git a/src/grt/grt-disp_rti.adb b/src/grt/grt-disp_rti.adb index 7aa97d1f8..b3b595668 100644 --- a/src/grt/grt-disp_rti.adb +++ b/src/grt/grt-disp_rti.adb @@ -226,13 +226,16 @@ package body Grt.Disp_Rti is -- FIXME: need to update bounds. else for I in 1 .. Length loop - Bounds2 := Bounds; if I /= 1 then Put (Stream, ", "); end if; if Index = Last_Idx then + -- Humm, not always an array, and BOUNDS may not be followed + -- by subelement bounds. + Bounds2 := Array_Layout_To_Bounds (Bounds); Disp_Value (Stream, El_Rti, Ctxt, Obj, Bounds2, Is_Sig); else + Bounds2 := Bounds; Disp_Array_Value_1 (Stream, Arr_Rti, Ctxt, Index + 1, Obj, Bounds2, Is_Sig); end if; diff --git a/src/grt/grt-rtis_utils.adb b/src/grt/grt-rtis_utils.adb index b3780801f..8f30aba43 100644 --- a/src/grt/grt-rtis_utils.adb +++ b/src/grt/grt-rtis_utils.adb @@ -354,12 +354,14 @@ package body Grt.Rtis_Utils is Cur_Bounds := Bounds; for I in 1 .. Len loop - Bounds := Cur_Bounds; Pos_To_Vstring (Name, Base_Type, Rng, I - 1); if Index = Last_Index then + -- FIXME: not always needed. + Bounds := Array_Layout_To_Bounds (Cur_Bounds); Append (Name, ')'); Handle_Any (El_Rti); else + Bounds := Cur_Bounds; Handle_Array_1 (Arr_Rti, Index + 1); end if; Truncate (Name, P + 1); -- cgit v1.2.3