This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada] Make sure subprogram locus is initialized
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 13 Dec 2017 10:30:44 +0100
- Subject: [Ada] Make sure subprogram locus is initialized
- Authentication-results: sourceware.org; auth=none
This is another fixlet aimed at making gigi more robust in the presence of
unexpected nodes in the expanded code.
Tested on x86_64-suse-linux, applied on the mainline and 7 branch.
2017-12-13 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Subprogram_Body_to_gnu): Initialize locus.
--
Eric Botcazou
Index: gcc-interface/trans.c
===================================================================
--- gcc-interface/trans.c (revision 255601)
+++ gcc-interface/trans.c (working copy)
@@ -3773,7 +3773,8 @@ Subprogram_Body_to_gnu (Node_Id gnat_nod
}
/* Set the line number in the decl to correspond to that of the body. */
- Sloc_to_locus (Sloc (gnat_node), &locus);
+ if (!Sloc_to_locus (Sloc (gnat_node), &locus))
+ locus = input_location;
DECL_SOURCE_LOCATION (gnu_subprog_decl) = locus;
/* If the body comes from an expression function, arrange it to be inlined