* gcc-interface/trans.c (process_freeze_entity): Be prepared for a
package without body.
From-SVN: r255601
+2017-12-13 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/trans.c (process_freeze_entity): Be prepared for a
+ package without body.
+
2017-12-13 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity): Robustify test for types
const Entity_Kind kind = Ekind (gnat_entity);
tree gnu_old, gnu_new;
- /* If this is a package, we need to generate code for the package. */
+ /* If this is a package, generate code for the package body, if any. */
if (kind == E_Package)
{
- insert_code_for
- (Parent (Corresponding_Body
- (Parent (Declaration_Node (gnat_entity)))));
+ const Node_Id gnat_decl = Parent (Declaration_Node (gnat_entity));
+ if (Present (Corresponding_Body (gnat_decl)))
+ insert_code_for (Parent (Corresponding_Body (gnat_decl)));
return;
}