Commit acc257bb by Ed Schonberg Committed by Pierre-Marie de Rodat

[Ada] Unnesting: robustify analysis of block statements

2018-06-11  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* exp_ch7.adb (Check_Unnesting_Elaboration_Code): Add guard.

From-SVN: r261409
parent d6cb7116
2018-06-11 Ed Schonberg <schonberg@adacore.com>
* exp_ch7.adb (Check_Unnesting_Elaboration_Code): Add guard.
2018-06-11 Ed Schonberg <schonberg@adacore.com>
* exp_unst.adb (Visit_Node): Skip generic associations.
2018-06-11 Arnaud Charlet <charlet@adacore.com>
......
......@@ -4002,10 +4002,8 @@ package body Exp_Ch7 is
then
Stat := First (Statements (Handled_Statement_Sequence (N)));
while Present (Stat) loop
if Nkind (Stat) = N_Block_Statement then
exit;
end if;
exit when Nkind (Stat) = N_Block_Statement
and then Present (Identifier (Stat));
Next (Stat);
end loop;
......@@ -4046,7 +4044,9 @@ package body Exp_Ch7 is
First (Statements (Handled_Statement_Sequence (Elab_Body)));
while Present (Stat) loop
if Nkind (Stat) = N_Block_Statement then
if Nkind (Stat) = N_Block_Statement
and then Present (Identifier (Stat))
then
Set_Scope (Entity (Identifier (Stat)), Elab_Proc);
end if;
......
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