[Ada] Fix crash on quantified expression in expression function (2)
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 26 May 2020 18:06:14 +0000 (20:06 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 10 Jul 2020 09:16:17 +0000 (05:16 -0400)
gcc/ada/

* freeze.adb (Freeze_Expr_Types): Replace call to Find_Aspect
with call to Find_Value_Of_Aspect and adjust accordingly.

gcc/ada/freeze.adb

index 6620ae3..65377ca 100644 (file)
@@ -8000,10 +8000,11 @@ package body Freeze is
          then
             declare
                Iter : constant Node_Id :=
-                           Find_Aspect (Etype (Node), Aspect_Default_Iterator);
+                 Find_Value_Of_Aspect (Etype (Node), Aspect_Default_Iterator);
+
             begin
                if Present (Iter) then
-                  Check_And_Freeze_Type (Etype (Expression (Iter)));
+                  Check_And_Freeze_Type (Etype (Iter));
                end if;
             end;
          end if;