]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: correction to gnatbind-related cleanups
authorBob Duff <duff@adacore.com>
Thu, 7 Mar 2024 15:55:56 +0000 (10:55 -0500)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 17 May 2024 08:21:02 +0000 (10:21 +0200)
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.

gcc/ada/uname.adb

index dbb08b88cfdc221d43bbc160f560d07d49f57fe5..5a7dac53b3d48cc072365ec517f1e2bcd2137b2b 100644 (file)
@@ -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