diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1fd528ccaf57..7f020e39b56a 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-12-11 Arnaud Charlet + + * exp_unst.adb (Unnest_Subprogram): Ensure Current_Subprogram is + always initialized. + 2018-12-11 Eric Botcazou * gcc-interface/decl.c (gnat_to_gnu_entity): Add diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index 57b2a9e190c6..f8c8fd56be11 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -440,7 +440,7 @@ package body Exp_Unst is Urefs.Init; Build_Tables : declare - Current_Subprogram : Entity_Id; + Current_Subprogram : Entity_Id := Empty; -- When we scan a subprogram body, we set Current_Subprogram to the -- corresponding entity. This gets recursively saved and restored.