diff options
-rw-r--r-- | gcc/ada/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 534b8cf..cf195b9 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -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. diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 7a83acf..0cf37f1 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -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 |