aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/restrict.adb
diff options
context:
space:
mode:
authorRonan Desplanques <desplanques@adacore.com>2024-02-13 12:46:36 +0100
committerMarc Poulhiès <poulhies@adacore.com>2024-05-14 10:19:56 +0200
commit996fd76402004d5f2fedbbf86cd8534e8c0c1f71 (patch)
treeae398aaaa2a62f2c1f75bb95ae909b47dfb62005 /gcc/ada/restrict.adb
parent34aba1547d277eb8c7fa5db7f58e35b1726693df (diff)
downloadgcc-996fd76402004d5f2fedbbf86cd8534e8c0c1f71.zip
gcc-996fd76402004d5f2fedbbf86cd8534e8c0c1f71.tar.gz
gcc-996fd76402004d5f2fedbbf86cd8534e8c0c1f71.tar.bz2
ada: Fix crash with -gnatdJ and JSON output
This patch tweaks the calls made to Errout subprograms to report violations of dependence restrictions, in order fix a crash that occurred with -gnatdJ and -fdiagnostics-format=json. gcc/ada/ * restrict.adb (Violation_Of_No_Dependence): Tweak error reporting calls.
Diffstat (limited to 'gcc/ada/restrict.adb')
-rw-r--r--gcc/ada/restrict.adb12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb
index 1cc75be..bda35d8 100644
--- a/gcc/ada/restrict.adb
+++ b/gcc/ada/restrict.adb
@@ -1704,16 +1704,16 @@ package body Restrict is
--------------------------------
procedure Violation_Of_No_Dependence (Unit : Int; N : Node_Id) is
+ Unit_Node : constant Node_Id := No_Dependences.Table (Unit).Unit;
begin
- Error_Msg_Node_1 := No_Dependences.Table (Unit).Unit;
- Error_Msg_Sloc := Sloc (Error_Msg_Node_1);
+ Error_Msg_Sloc := Sloc (Unit_Node);
if No_Dependences.Table (Unit).Warn then
- Error_Msg
- ("?*?violation of restriction `No_Dependence '='> &`#", Sloc (N));
+ Error_Msg_NE ("?*?violation of restriction `No_Dependence '='> &`#",
+ N, Unit_Node);
else
- Error_Msg
- ("|violation of restriction `No_Dependence '='> &`#", Sloc (N));
+ Error_Msg_NE ("|violation of restriction `No_Dependence '='> &`#", N,
+ Unit_Node);
end if;
end Violation_Of_No_Dependence;