diff options
author | Léo Creuse <creuse@adacore.com> | 2023-07-18 11:08:23 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-08-01 10:06:44 +0200 |
commit | 7fef55ece2345a14d351a89cfd611482bb9a025f (patch) | |
tree | ec57f64e8e05b2f6bb3b67a56bcd77b9192712e1 /gcc | |
parent | 46a508ec7aee5038cc0a8800b756838ebef7f6d2 (diff) | |
download | gcc-7fef55ece2345a14d351a89cfd611482bb9a025f.zip gcc-7fef55ece2345a14d351a89cfd611482bb9a025f.tar.gz gcc-7fef55ece2345a14d351a89cfd611482bb9a025f.tar.bz2 |
ada: Emit SCOs for nested decisions in quantified expressions
The tree traversal for decision SCO emission did not recurse in the
iterator specification or loop parameter specification of quantified
expressions, resulting in missing coverage obligations for nested
decisions. This change fixes this by traversing all the attributes
of quantified expressions nodes.
gcc/ada/
* par_sco.adb (Process_Decisions): Traverse all attributes of
quantified expressions nodes.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/par_sco.adb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ada/par_sco.adb b/gcc/ada/par_sco.adb index ce7de7f..5e65fa2 100644 --- a/gcc/ada/par_sco.adb +++ b/gcc/ada/par_sco.adb @@ -829,8 +829,15 @@ package body Par_SCO is when N_Quantified_Expression => declare - Cond : constant Node_Id := Condition (N); + Cond : constant Node_Id := Condition (N); + I_Spec : Node_Id := Empty; begin + if Present (Iterator_Specification (N)) then + I_Spec := Iterator_Specification (N); + else + I_Spec := Loop_Parameter_Specification (N); + end if; + Process_Decisions (I_Spec, 'X', Pragma_Sloc); Process_Decisions (Cond, 'W', Pragma_Sloc); return Skip; end; |