]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix wrong handling of wide wide characters in Append_Decoded_With_Brackets
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 14 Sep 2024 12:48:24 +0000 (14:48 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 25 Oct 2024 09:08:59 +0000 (11:08 +0200)
This only shows up at link time when the name of a compilation unit contains
a wide wide character.

gcc/ada/ChangeLog:

* namet.adb (Append_Decoded_With_Brackets): Fix condition for the
cheap test at the beginning of the loop.

gcc/ada/namet.adb

index 72f6c2088db01038f2bec600dbfc07a658113f8f..2e3b9c014fc4393ee9e4dcbb00767f0dc706588e 100644 (file)
@@ -474,7 +474,11 @@ package body Namet is
 
             P := 1;
             while P < Temp.Length loop
-               if Temp.Chars (P + 1) in 'A' .. 'Z' then
+               --  Cheap test for the common case of no encoding
+
+               if Temp.Chars (P + 1) in 'A' .. 'Z'
+                 and then Temp.Chars (P + 1) /= 'W'
+               then
                   P := P + 1;
 
                --  Uhh encoding