CodePeer analysis of GNAT showed that a parameter was not read and
always set on all paths, making it an out rather than an in-out.
This was not detected by the compiler, because one path ends up
raising an exception, which is not taken into account in the simpler
analysis done in GNAT.

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

2017-11-16  Yannick Moy  <m...@adacore.com>

        * sem_elab.adb (Include): Fix mode of parameter Curr to out.

Index: sem_elab.adb
===================================================================
--- sem_elab.adb        (revision 254804)
+++ sem_elab.adb        (working copy)
@@ -4242,7 +4242,7 @@
       --  Determine whether list List contains at least one suitable construct
       --  for inclusion into an early call region.
 
-      procedure Include (N : Node_Id; Curr : in out Node_Id);
+      procedure Include (N : Node_Id; Curr : out Node_Id);
       pragma Inline (Include);
       --  Update the Curr and Start pointers to include arbitrary construct N
       --  in the early call region. This routine raises ECR_Found.
@@ -4556,7 +4556,7 @@
       -- Include --
       -------------
 
-      procedure Include (N : Node_Id; Curr : in out Node_Id) is
+      procedure Include (N : Node_Id; Curr : out Node_Id) is
       begin
          Start := N;
 

Reply via email to