aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2020-11-08 16:54:56 -0500
committerPierre-Marie de Rodat <derodat@adacore.com>2020-11-30 09:16:16 -0500
commita442bed36cfbfb739244963f22eaf10320a27ec9 (patch)
treed9ae488fac05a29ba1a7f9fc4a739c39e1546289
parentf456de4c432c6f44cc0de9ccc19a4ff4eadb8f9c (diff)
downloadgcc-a442bed36cfbfb739244963f22eaf10320a27ec9.zip
gcc-a442bed36cfbfb739244963f22eaf10320a27ec9.tar.gz
gcc-a442bed36cfbfb739244963f22eaf10320a27ec9.tar.bz2
[Ada] Crash on ghost assignment check for illegal code
gcc/ada/ * errout.adb (Error_Msg_NEL): Do not call Set_Posted if errors are being ignored. (Error_Msg): Change Errors_Must_Be_Ignored to use the getter. * sem_ch8.adb (Find_Direct_Name): Do not skip all the error checks when ignoring errors, but instead do not add an entry to the Urefs table if errors are being ignored. * exp_ch5.adb: Minor comment fix.
-rw-r--r--gcc/ada/errout.adb6
-rw-r--r--gcc/ada/exp_ch5.adb2
-rw-r--r--gcc/ada/sem_ch8.adb11
3 files changed, 9 insertions, 10 deletions
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb
index 049db89..fbbf579 100644
--- a/gcc/ada/errout.adb
+++ b/gcc/ada/errout.adb
@@ -337,7 +337,7 @@ package body Errout is
begin
-- Return if all errors are to be ignored
- if Errors_Must_Be_Ignored then
+ if Get_Ignore_Errors then
return;
end if;
@@ -1430,7 +1430,9 @@ package body Errout is
Last_Killed := True;
end if;
- Set_Posted (N);
+ if not Get_Ignore_Errors then
+ Set_Posted (N);
+ end if;
end Error_Msg_NEL;
------------------
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 93351cf..e720656 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -1469,7 +1469,7 @@ package body Exp_Ch5 is
-- there are volatile or independent components. If the Prefix of the
-- slice is a component or slice, then it might be a part of an object
-- with some other volatile or independent components, so we disable the
- -- optimization in that case as well. We could complicate this code by
+ -- optimization in that case as well. We could complicate this code by
-- actually looking for such volatile and independent components.
if Is_Bit_Packed_Array (L_Type)
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index f78d31a..07484d5 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -5622,7 +5622,10 @@ package body Sem_Ch8 is
-- undefined reference. The entry is not added if we are ignoring
-- errors.
- if not All_Errors_Mode and then Ignore_Errors_Enable = 0 then
+ if not All_Errors_Mode
+ and then Ignore_Errors_Enable = 0
+ and then not Get_Ignore_Errors
+ then
Urefs.Append (
(Node => N,
Err => Emsg,
@@ -5752,12 +5755,6 @@ package body Sem_Ch8 is
E := Homonym (E);
end loop;
- -- If we are ignoring errors, skip the error processing
-
- if Get_Ignore_Errors then
- return;
- end if;
-
-- If no entries on homonym chain that were potentially visible,
-- and no entities reasonably considered as non-visible, then
-- we have a plain undefined reference, with no additional