From: Bob Duff <[email protected]>
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.
Tested on x86_64-pc-linux-gnu, committed on master.
---
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 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
--
2.43.2