[Ada] Fix crash when printing error message
authorJustin Squirek <squirek@adacore.com>
Thu, 8 Apr 2021 08:44:19 +0000 (10:44 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 5 Jul 2021 13:09:09 +0000 (13:09 +0000)
gcc/ada/

* freeze.adb (Freeze_Profile): Use N's Sloc, F_type's chars.

gcc/ada/freeze.adb

index 23b64a0..21d24cd 100644 (file)
@@ -4141,9 +4141,10 @@ package body Freeze is
                elsif not After_Last_Declaration
                  and then not Freezing_Library_Level_Tagged_Type
                then
-                  Error_Msg_Node_1 := F_Type;
-                  Error_Msg_N
-                    ("type & must be fully defined before this point", N);
+                  Error_Msg_NE
+                    ("type & must be fully defined before this point",
+                     N,
+                     F_Type);
                end if;
             end if;