public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Fix more precise mode for parameter
@ 2017-11-16 10:24 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2017-11-16 10:24 UTC (permalink / raw)
  To: gcc-patches; +Cc: Yannick Moy

[-- Attachment #1: Type: text/plain, Size: 447 bytes --]

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  <moy@adacore.com>

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


[-- Attachment #2: difs --]
[-- Type: text/plain, Size: 843 bytes --]

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;
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-16 10:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-16 10:24 [Ada] Fix more precise mode for parameter Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).