From: Viljar Indus Date: Tue, 14 Oct 2025 09:02:13 +0000 (+0300) Subject: ada: Fix Put_Image for Multiway_Trees X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=43ce88299a47e13927219947e449fd75d649f3fd;p=thirdparty%2Fgcc.git ada: Fix Put_Image for Multiway_Trees Put_Image should start printing the tree from the Root instead of the First_Child. gcc/ada/ChangeLog: * libgnat/a-cbmutr.adb (Put_Image): Fix the condition and starting point for printing the tree. * libgnat/a-cimutr.adb (Put_Image): Likewise. * libgnat/a-comutr.adb (Put_Image): Likewise. --- diff --git a/gcc/ada/libgnat/a-cbmutr.adb b/gcc/ada/libgnat/a-cbmutr.adb index 9d9d21d2c39..bd6b1359f96 100644 --- a/gcc/ada/libgnat/a-cbmutr.adb +++ b/gcc/ada/libgnat/a-cbmutr.adb @@ -2357,11 +2357,11 @@ is end Rec; begin - if First_Child (Root (V)) = No_Element then + if Is_Empty (V) then Array_Before (S); Array_After (S); else - Rec (First_Child (Root (V))); + Rec (Root (V)); end if; end Put_Image; diff --git a/gcc/ada/libgnat/a-cimutr.adb b/gcc/ada/libgnat/a-cimutr.adb index b84eb16024b..0c6d33828b1 100644 --- a/gcc/ada/libgnat/a-cimutr.adb +++ b/gcc/ada/libgnat/a-cimutr.adb @@ -1910,11 +1910,11 @@ is end Rec; begin - if First_Child (Root (V)) = No_Element then + if Is_Empty (V) then Array_Before (S); Array_After (S); else - Rec (First_Child (Root (V))); + Rec (Root (V)); end if; end Put_Image; diff --git a/gcc/ada/libgnat/a-comutr.adb b/gcc/ada/libgnat/a-comutr.adb index df3741bbbb0..2d6393db35a 100644 --- a/gcc/ada/libgnat/a-comutr.adb +++ b/gcc/ada/libgnat/a-comutr.adb @@ -1844,11 +1844,11 @@ is end Rec; begin - if First_Child (Root (V)) = No_Element then + if Is_Empty (V) then Array_Before (S); Array_After (S); else - Rec (First_Child (Root (V))); + Rec (Root (V)); end if; end Put_Image;