diff options
author | Arnaud Charlet <charlet@adacore.com> | 2020-12-03 10:06:47 -0500 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-04-28 05:38:04 -0400 |
commit | ff683f9f0341391253eef171890f1b98f18ec99d (patch) | |
tree | 1574b25474bb0dbc8d01b42679ba42017f8ea95d /gcc/ada/sem_ch4.adb | |
parent | df5f901ce89cdbf73ae827ee528da776cbcacfac (diff) | |
download | gcc-ff683f9f0341391253eef171890f1b98f18ec99d.zip gcc-ff683f9f0341391253eef171890f1b98f18ec99d.tar.gz gcc-ff683f9f0341391253eef171890f1b98f18ec99d.tar.bz2 |
[Ada] Crash with declare expression used in a postcondition
gcc/ada/
* sem_aux.adb (Is_Limited_Type): Fix logic to check Is_Type
before assuming Ent is a typo.
* sem_ch4.adb (Analyze_Expression_With_Actions): Update
comments, minor reformatting.
* sem_res.adb (Resolve_Declare_Expression): Add protection
against no type.
Diffstat (limited to 'gcc/ada/sem_ch4.adb')
-rw-r--r-- | gcc/ada/sem_ch4.adb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 7a8c261..ad6c7fd 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -2278,9 +2278,12 @@ package body Sem_Ch4 is procedure Analyze_Expression_With_Actions (N : Node_Id) is procedure Check_Action_OK (A : Node_Id); - -- Check that the action is something that is allows as a declare_item - -- of a declare_expression, except the checks are suppressed for - -- generated code. + -- Check that the action A is allowed as a declare_item of a declare + -- expression if N and A come from source. + + --------------------- + -- Check_Action_OK -- + --------------------- procedure Check_Action_OK (A : Node_Id) is begin @@ -2324,7 +2327,7 @@ package body Sem_Ch4 is Error_Msg_N ("object renaming or constant declaration expected", A); end Check_Action_OK; - A : Node_Id; + A : Node_Id; EWA_Scop : Entity_Id; -- Start of processing for Analyze_Expression_With_Actions |