]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Emit SCOs for nested decisions in quantified expressions
authorLéo Creuse <creuse@adacore.com>
Tue, 18 Jul 2023 09:08:23 +0000 (11:08 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 1 Aug 2023 08:06:44 +0000 (10:06 +0200)
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.

gcc/ada/par_sco.adb

index ce7de7f3d7955e55bda3dd4fe89d332a3644fa24..5e65fa25de1dc1e89c925e0b16aaa3156c015769 100644 (file)
@@ -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;