https://gcc.gnu.org/g:bf935572b076b822033cf1e9d31312c75e4c90d3

commit r15-601-gbf935572b076b822033cf1e9d31312c75e4c90d3
Author: Bob Duff <d...@adacore.com>
Date:   Thu Mar 7 10:55:56 2024 -0500

    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:
---
 gcc/ada/uname.adb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/uname.adb b/gcc/ada/uname.adb
index dbb08b88cfdc..5a7dac53b3d4 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

Reply via email to