Commit bc3fb397 by Arnaud Charlet Committed by Pierre-Marie de Rodat

[Ada] Fix various defects found by static analysis

2018-05-23  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* checks.adb (Minimize_Eliminate_Overflows): Default initialize Lo and
	Hi.
	* sem_elab.adb: Make "out" parameters instead of "in out" when
	relevant.

From-SVN: r260594
parent b77c24b8
2018-05-23 Arnaud Charlet <charlet@adacore.com>
* checks.adb (Minimize_Eliminate_Overflows): Default initialize Lo and
Hi.
* sem_elab.adb: Make "out" parameters instead of "in out" when
relevant.
2018-05-23 Bob Duff <duff@adacore.com>
* gnatbind.adb (List_Applicable_Restrictions): Add
......
......@@ -8379,6 +8379,12 @@ package body Checks is
-- Start of processing for Minimize_Eliminate_Overflows
begin
-- Default initialize Lo and Hi since these are not guaranteed to be
-- set otherwise.
Lo := No_Uint;
Hi := No_Uint;
-- Case where we do not have a signed integer arithmetic operation
if not Is_Signed_Integer_Arithmetic_Op (N) then
......
......@@ -4494,27 +4494,27 @@ package body Sem_Elab is
procedure Transition_Body_Declarations
(Bod : Node_Id;
Curr : in out Node_Id);
Curr : out Node_Id);
pragma Inline (Transition_Body_Declarations);
-- Update the Curr and Start pointers when construct Bod denotes a block
-- statement or a suitable body. This routine raises ECR_Found.
procedure Transition_Handled_Statements
(HSS : Node_Id;
Curr : in out Node_Id);
Curr : out Node_Id);
pragma Inline (Transition_Handled_Statements);
-- Update the Curr and Start pointers when node HSS denotes a handled
-- sequence of statements. This routine raises ECR_Found.
procedure Transition_Spec_Declarations
(Spec : Node_Id;
Curr : in out Node_Id);
Curr : out Node_Id);
pragma Inline (Transition_Spec_Declarations);
-- Update the Curr and Start pointers when construct Spec denotes
-- a concurrent definition or a package spec. This routine raises
-- ECR_Found.
procedure Transition_Unit (Unit : Node_Id; Curr : in out Node_Id);
procedure Transition_Unit (Unit : Node_Id; Curr : out Node_Id);
pragma Inline (Transition_Unit);
-- Update the Curr and Start pointers when node Unit denotes a potential
-- compilation unit. This routine raises ECR_Found.
......@@ -4907,7 +4907,7 @@ package body Sem_Elab is
procedure Transition_Body_Declarations
(Bod : Node_Id;
Curr : in out Node_Id)
Curr : out Node_Id)
is
Decls : constant List_Id := Declarations (Bod);
......@@ -4935,7 +4935,7 @@ package body Sem_Elab is
procedure Transition_Handled_Statements
(HSS : Node_Id;
Curr : in out Node_Id)
Curr : out Node_Id)
is
Bod : constant Node_Id := Parent (HSS);
Decls : constant List_Id := Declarations (Bod);
......@@ -4986,7 +4986,7 @@ package body Sem_Elab is
procedure Transition_Spec_Declarations
(Spec : Node_Id;
Curr : in out Node_Id)
Curr : out Node_Id)
is
Prv_Decls : constant List_Id := Private_Declarations (Spec);
Vis_Decls : constant List_Id := Visible_Declarations (Spec);
......@@ -5048,7 +5048,7 @@ package body Sem_Elab is
procedure Transition_Unit
(Unit : Node_Id;
Curr : in out Node_Id)
Curr : out Node_Id)
is
Context : constant Node_Id := Parent (Unit);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment