[Ada] Crash on precondition, discriminant and protected objects
authorArnaud Charlet <charlet@adacore.com>
Thu, 16 Jul 2020 12:27:54 +0000 (08:27 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 20 Oct 2020 07:21:39 +0000 (03:21 -0400)
gcc/ada/

* contracts.adb (Is_Prologue_Renaming): This function was
missing support for E_Constant which can also be generated in
protected objects.

gcc/ada/contracts.adb

index e633e19c1d84822e7c078903fff753f7683340b8..71a9bf143e4728994218237d9afe5c778bcd72d1 100644 (file)
@@ -2333,7 +2333,7 @@ package body Contracts is
                   --  A renamed private component is just a component of
                   --  _object, with an arbitrary name.
 
-                  elsif Ekind (Obj) = E_Variable
+                  elsif Ekind (Obj) in E_Variable | E_Constant
                     and then Nkind (Pref) = N_Identifier
                     and then Chars (Pref) = Name_uObject
                     and then Nkind (Sel) = N_Identifier