From: Bob Duff Date: Thu, 7 Mar 2024 15:55:56 +0000 (-0500) Subject: ada: correction to gnatbind-related cleanups X-Git-Tag: basepoints/gcc-16~8952 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf935572b076b822033cf1e9d31312c75e4c90d3;p=thirdparty%2Fgcc.git ada: correction to gnatbind-related cleanups Correction to previous change; Asserts had been moved to before Buf was initialized. gcc/ada/ * uname.adb (Get_Unit_Name_String): Move Asserts after Buf is initialized. --- diff --git a/gcc/ada/uname.adb b/gcc/ada/uname.adb index dbb08b88cfd..5a7dac53b3d 100644 --- a/gcc/ada/uname.adb +++ b/gcc/ada/uname.adb @@ -404,11 +404,10 @@ package body Uname is Suffix : Boolean := True) is begin - pragma Assert (Buf.Chars (1) /= '"'); - pragma Assert (Is_Body_Name (N) or else Is_Spec_Name (N)); - Buf.Length := 0; Append_Decoded (Buf, N); + pragma Assert (Buf.Chars (1) /= '"'); + pragma Assert (Is_Body_Name (N) or else Is_Spec_Name (N)); -- Buf always ends with "%s" or "%b", which we either remove, or replace -- with " (spec)" or " (body)". Set_Casing of Buf after checking for