* gcc-interface/trans.c (Subprogram_Body_to_gnu): Initialize locus.
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 13 Dec 2017 09:30:25 +0000 (09:30 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 13 Dec 2017 09:30:25 +0000 (09:30 +0000)
From-SVN: r255603

gcc/ada/ChangeLog
gcc/ada/gcc-interface/trans.c

index 534b8cf..cf195b9 100644 (file)
@@ -1,5 +1,9 @@
 2017-12-13  Eric Botcazou  <ebotcazou@adacore.com>
 
+       * gcc-interface/trans.c (Subprogram_Body_to_gnu): Initialize locus.
+
+2017-12-13  Eric Botcazou  <ebotcazou@adacore.com>
+
        * gcc-interface/trans.c (process_freeze_entity): Be prepared for a
        package without body.
 
index 7a83acf..0cf37f1 100644 (file)
@@ -3773,7 +3773,8 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
     }
 
   /* 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