]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Inconsistent scope chain due to quantified expression
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Aug 2019 09:50:34 +0000 (09:50 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Aug 2019 09:50:34 +0000 (09:50 +0000)
Routine Build_DIC_Procedure_Declaration appears to be heavily inspired
by Build_Invariant_Procedure_Declaration; they both wrap an expression
attached to a type inside an internal procedure. Initially none of them
were calling Set_Last_Entity.

For Build_Invariant_Procedure_Declaration this was fixed previously.
For Build_DIC_Procedure_Declaration this is fixed here.

The issue affects the GNATprove tool and is not visible to end users of
the GNAT compiler. No simple test is available because this would
require a debug session.

2019-08-20  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* exp_util.adb (Build_DIC_Procedure_Declaration): Set the last
entity of the generated Default_Initial_Condition procedure in
order to construct a proper entity chain.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@274741 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/exp_util.adb

index a27d1d9fb0d8c4ab0f7e2c73fb86c315d1d20f88..f914d0676d3fe1b6ee2abf2977549c6f23ded2f4 100644 (file)
@@ -1,3 +1,9 @@
+2019-08-20  Piotr Trojanek  <trojanek@adacore.com>
+
+       * exp_util.adb (Build_DIC_Procedure_Declaration): Set the last
+       entity of the generated Default_Initial_Condition procedure in
+       order to construct a proper entity chain.
+
 2019-08-20  Yannick Moy  <moy@adacore.com>
 
        * exp_spark.adb (Expand_SPARK_N_Slice_Or_Indexed_Component):
index 41708c3097f328401cf9bc14730aaa9916e8b774..78019ab3c32389a8ea42a8d415434c65225359cb 100644 (file)
@@ -1977,6 +1977,7 @@ package body Exp_Util is
       Set_Scope (Obj_Id, Proc_Id);
 
       Set_First_Entity (Proc_Id, Obj_Id);
+      Set_Last_Entity  (Proc_Id, Obj_Id);
 
       --  Generate:
       --    procedure <Work_Typ>DIC (_object : <Work_Typ>);