===================================================================
@@ -2001,6 +2001,7 @@
if Is_Access_Type (Typ)
and then Can_Never_Be_Null (Etype (Lhs))
and then not Can_Never_Be_Null (Etype (Rhs))
+ and then not Suppress_Assignment_Checks (N)
then
Apply_Constraint_Check (Rhs, Etype (Lhs));
end if;
===================================================================
@@ -2052,7 +2052,9 @@
-- and range checks in cases where the generated code knows that the
-- value being assigned is in range and satisfies any predicate. Also
-- can be set in N_Object_Declaration nodes, to similarly suppress any
- -- checks on the initializing value.
+ -- checks on the initializing value. In assignment statements it also
+ -- suppresses access checks in the generated code for out- and in-out
+ -- parameters in entry calls.
-- Suppress_Loop_Warnings (Flag17-Sem)
-- Used in N_Loop_Statement node to indicate that warnings within the
===================================================================
@@ -4755,7 +4755,8 @@
-- case of limited type. We cannot assign it unless the
-- Assignment_OK flag is set first. An out formal of an
-- access type must also be initialized from the actual,
- -- as stated in RM 6.4.1 (13).
+ -- as stated in RM 6.4.1 (13), but no constraint is applied
+ -- before the call.
if Ekind (Formal) /= E_Out_Parameter
or else Is_Access_Type (Etype (Formal))
@@ -4767,6 +4768,7 @@
Make_Assignment_Statement (Loc,
Name => N_Var,
Expression => Relocate_Node (Actual)));
+ Set_Suppress_Assignment_Checks (Last (Stats));
end if;
Append (N_Node, Decls);