ada: Fix inherited postconditions in inlined subprograms
Protect the building of postcondition pragmas in case the postcondition is not present due to inlining. gcc/ada/ * freeze.adb (Build_Inherited_Condition_Pragmas): Do nothing if A_Post is empty.
This commit is contained in:
parent
b86ff06123
commit
27345558cc
1 changed files with 10 additions and 5 deletions
|
@ -1718,11 +1718,16 @@ package body Freeze is
|
||||||
end;
|
end;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
New_Prag := New_Copy_Tree (A_Post);
|
-- A_Post can be null here if the postcondition was inlined in the
|
||||||
Rewrite
|
-- called subprogram.
|
||||||
(Expression (First (Pragma_Argument_Associations (New_Prag))),
|
|
||||||
Class_Post);
|
if Present (A_Post) then
|
||||||
Append (New_Prag, Decls);
|
New_Prag := New_Copy_Tree (A_Post);
|
||||||
|
Rewrite
|
||||||
|
(Expression (First (Pragma_Argument_Associations (New_Prag))),
|
||||||
|
Class_Post);
|
||||||
|
Append (New_Prag, Decls);
|
||||||
|
end if;
|
||||||
end if;
|
end if;
|
||||||
end Build_Inherited_Condition_Pragmas;
|
end Build_Inherited_Condition_Pragmas;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue