]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Ensure variable is initialized before use
authorRonan Desplanques <desplanques@adacore.com>
Fri, 12 Jul 2024 08:56:58 +0000 (10:56 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 2 Aug 2024 07:08:08 +0000 (09:08 +0200)
This patch is motivated by a GNAT SAS report.

gcc/ada/

* scng.adb (Slit): Initialize object in uncommon path.

gcc/ada/scng.adb

index c9ccc4d9b52fe6ac6a0db6e1cd522003b5e26e5d..08ce2ab5ad1c2ac86e17b7c14698c6557639cf8e 100644 (file)
@@ -1166,6 +1166,7 @@ package body Scng is
                      when '\' | '"' | '{' | '}'
                               => Code := Get_Char_Code (C);
                      when others =>
+                        Code := Get_Char_Code ('?');
                         Error_Msg_S ("illegal escaped character");
                   end case;