Commit 022c9dfe by Ed Schonberg Committed by Pierre-Marie de Rodat

[Ada] Do not crash with -gnatR3 on Ghost aspects

2019-08-14  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_aux.adb (Next_Rep_Item): If a node in the rep chain
	involves a Ghost aspect it may have been replaced by a null
	statement; use the original node to find next Rep_Item.
	* repinfo.adb (List_Entities): Do not list an Ignored
	Ghost_Entity, for which information may have been deleted.

From-SVN: r274470
parent 0246fe44
2019-08-14 Ed Schonberg <schonberg@adacore.com>
* sem_aux.adb (Next_Rep_Item): If a node in the rep chain
involves a Ghost aspect it may have been replaced by a null
statement; use the original node to find next Rep_Item.
* repinfo.adb (List_Entities): Do not list an Ignored
Ghost_Entity, for which information may have been deleted.
2019-08-14 Bob Duff <duff@adacore.com>
* sem_prag.ads, sem_prag.adb
......
......@@ -479,6 +479,7 @@ package body Repinfo is
if Present (Ent)
and then Nkind (Declaration_Node (Ent)) not in N_Renaming_Declaration
and then not Is_Ignored_Ghost_Entity (Ent)
then
-- If entity is a subprogram and we are listing mechanisms,
-- then we need to list mechanisms for this entity. We skip this
......
......@@ -569,6 +569,12 @@ package body Sem_Aux is
elsif Entity (N) = E then
return N;
end if;
-- A Ghost-related aspect, if disabled, may have been replaced by a
-- null statement.
elsif Nkind (N) = N_Null_Statement then
N := Original_Node (N);
end if;
Next_Rep_Item (N);
......
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