Commit aa090e20 by Piotr Trojanek Committed by Pierre-Marie de Rodat

[Ada] Inconsistent scope chain due to quantified expression

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.

From-SVN: r274741
parent dd6e65c6
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> 2019-08-20 Yannick Moy <moy@adacore.com>
* exp_spark.adb (Expand_SPARK_N_Slice_Or_Indexed_Component): * exp_spark.adb (Expand_SPARK_N_Slice_Or_Indexed_Component):
......
...@@ -1977,6 +1977,7 @@ package body Exp_Util is ...@@ -1977,6 +1977,7 @@ package body Exp_Util is
Set_Scope (Obj_Id, Proc_Id); Set_Scope (Obj_Id, Proc_Id);
Set_First_Entity (Proc_Id, Obj_Id); Set_First_Entity (Proc_Id, Obj_Id);
Set_Last_Entity (Proc_Id, Obj_Id);
-- Generate: -- Generate:
-- procedure <Work_Typ>DIC (_object : <Work_Typ>); -- procedure <Work_Typ>DIC (_object : <Work_Typ>);
......
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