Patchwork [Ada] Analyze pre/post expression for correctness in formal verification mode

login
register
mail settings
Submitter Arnaud Charlet
Date Aug. 29, 2011, 8:22 a.m.
Message ID <20110829082209.GA13955@adacore.com>
Download mbox | patch
Permalink /patch/111971/
State New
Headers show

Comments

Arnaud Charlet - Aug. 29, 2011, 8:22 a.m.
Since expansion of pre/post is skipped in formal verification mode, the
analysis of pre/post expressions for correctness, and to complete nodes with
their types, was missing. Now corrected.

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

2011-08-29  Yannick Moy  <moy@adacore.com>

	* sem_prag.adb (Check_Precondition_Postcondition): In formal
	verification mode, analyze pragma expression for correctness, for
	pre/post on library-level subprogram, as it is not expanded later.

Patch

Index: sem_prag.adb
===================================================================
--- sem_prag.adb	(revision 178155)
+++ sem_prag.adb	(working copy)
@@ -1884,6 +1884,15 @@ 
          --  See if it is in the pragmas after a library level subprogram
 
          elsif Nkind (Parent (N)) = N_Compilation_Unit_Aux then
+
+            --  In formal verification mode, analyze pragma expression for
+            --  correctness, as it is not expanded later.
+
+            if ALFA_Mode then
+               Analyze_PPC_In_Decl_Part
+                 (N, Defining_Entity (Unit (Parent (Parent (N)))));
+            end if;
+
             Chain_PPC (Unit (Parent (Parent (N))));
             return;
          end if;