-- cleanup operations have been delayed, and the subprogram
-- has been rewritten in the expansion of the enclosing
-- protected body. It is the corresponding subprogram that
- -- may require the cleanup operations.
+ -- may require the cleanup operations, so propagate the
+ -- information that triggers cleanup activity.
Set_Uses_Sec_Stack
(Protected_Body_Subprogram (Scop),
Uses_Sec_Stack (Scop));
+ Set_Finalization_Chain_Entity
+ (Protected_Body_Subprogram (Scop),
+ Finalization_Chain_Entity (Scop));
Scop := Protected_Body_Subprogram (Scop);
end if;