[COMMITTED,03/31] ada: Remove trailing NUL in minimal expansion of Put_Image attribute

Message ID 20240521073035.314024-3-poulhies@adacore.com
State Committed
Commit 1bc1fa1160f186b1120bf354f3be3f9b0bf536fb
Series [COMMITTED,01/31] ada: Add new Mingw task priority mapping |

Commit Message

Marc Poulhiès May 21, 2024, 7:30 a.m. UTC
  From: Piotr Trojanek <trojanek@adacore.com>

When procedure that implements Put_Image attribute emits the type name,
this name was wrongly followed by a NUL character.


	* exp_put_image.adb (Build_Record_Put_Image_Procedure): Remove
	trailing NUL from the fully qualified type name.

Tested on x86_64-pc-linux-gnu, committed on master.

 gcc/ada/exp_put_image.adb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)


diff --git a/gcc/ada/exp_put_image.adb b/gcc/ada/exp_put_image.adb
index c23b4e24354..f5141a56626 100644
--- a/gcc/ada/exp_put_image.adb
+++ b/gcc/ada/exp_put_image.adb
@@ -832,7 +832,9 @@  package body Exp_Put_Image is
                 Parameter_Associations => New_List
                   (Make_Identifier (Loc, Name_S),
                    Make_String_Literal (Loc,
-                     To_String (Fully_Qualified_Name_String (Btyp))))));
+                     To_String
+                       (Fully_Qualified_Name_String
+                          (Btyp, Append_NUL => False))))));
          end if;
       elsif Is_Null_Record_Type (Btyp, Ignore_Privacy => True) then