diff mbox series

[Ada] Initialize local variables related to static expression functions

Message ID 20210709123813.GA3875684@adacore.com
State New
Headers show
Series [Ada] Initialize local variables related to static expression functions | expand

Commit Message

Pierre-Marie de Rodat July 9, 2021, 12:38 p.m. UTC
Explicitly initialize local variables related to analysis of expression
functions to prevent spurious checks from static analysers.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* sem_ch6.adb (Analyze_Expression_Function): Initialize Orig_N
	and Typ variables.
diff mbox series

Patch

diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -298,9 +298,9 @@  package body Sem_Ch6 is
       Asp      : Node_Id;
       New_Body : Node_Id;
       New_Spec : Node_Id;
-      Orig_N   : Node_Id;
+      Orig_N   : Node_Id := Empty;
       Ret      : Node_Id;
-      Typ      : Entity_Id;
+      Typ      : Entity_Id := Empty;
 
       Def_Id : Entity_Id := Empty;
       Prev   : Entity_Id;