[Ada] Crash on overriding of an abstract primitive on an incomplete type
authorArnaud Charlet <charlet@adacore.com>
Mon, 8 Mar 2021 12:11:32 +0000 (07:11 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 17 Jun 2021 14:32:17 +0000 (10:32 -0400)
gcc/ada/

* sem_ch3.adb (Check_Ops_From_Incomplete_Type): Protect against
no Primitive_Operations.

gcc/ada/sem_ch3.adb

index 6720d41..d807b10 100644 (file)
@@ -3072,6 +3072,7 @@ package body Sem_Ch3 is
            and then Ekind (Prev) = E_Incomplete_Type
            and then Is_Tagged_Type (Prev)
            and then Is_Tagged_Type (T)
+           and then Present (Primitive_Operations (Prev))
          then
             Elmt := First_Elmt (Primitive_Operations (Prev));
             while Present (Elmt) loop