[Ada] Incorrect runtime accessibility check on access discriminant
authorJustin Squirek <squirek@adacore.com>
Fri, 23 Oct 2020 15:31:07 +0000 (11:31 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 26 Nov 2020 08:39:45 +0000 (03:39 -0500)
gcc/ada/

* exp_ch4.adb (Expand_N_Type_Conversion): Use the unexpanded
operand when generating accessibility checks.

gcc/ada/exp_ch4.adb

index 102f7ae6bd6625c030bacc73b97ba13312f5f112..6899e620763e889db9a7d7ddfcb074943f57bb43 100644 (file)
@@ -12258,7 +12258,7 @@ package body Exp_Ch4 is
 
             else
                Apply_Accessibility_Check
-                 (Operand_Acc, Target_Type, Insert_Node => Operand);
+                 (Operand, Target_Type, Insert_Node => Operand);
             end if;
 
          --  If the level of the operand type is statically deeper than the