diff mbox series

[COMMITTED,16/26] ada: Ensure variable is initialized before use

Message ID 20240802071210.413366-16-poulhies@adacore.com
State New
Headers show
Series [COMMITTED,01/26] ada: Fix detection of suspicious loop patterns | expand

Commit Message

Marc Poulhiès Aug. 2, 2024, 7:11 a.m. UTC
From: Ronan Desplanques <desplanques@adacore.com>

This patch is motivated by a GNAT SAS report.

gcc/ada/

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

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/scng.adb | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/gcc/ada/scng.adb b/gcc/ada/scng.adb
index c9ccc4d9b52..08ce2ab5ad1 100644
--- a/gcc/ada/scng.adb
+++ b/gcc/ada/scng.adb
@@ -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;