This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Defered finalization actions for protected operations


When a subprogram body contain a package instantiation, we defer cleanup
actions until intance bodies are created, because they might require additional
cleanup expansions, for example involving task activation. For protected
operations, the body that needs cleanup actions is the internally generated
protected body, and some information must be propagated from the source entity
to the entity of the protected body. The code did not transfer the finalization
list that may have been generated earlier for controlled objects, leading to
access-before-elaboration crashes in the back-end.

See gnat.dg/set_in_pproc.adb

Tested on i686-pc-linux-gnu, committed on trunk

2008-05-26  Ed Schonberg  <schonberg@adacore.com>

	* inline.adb:
	(Cleanup_Scopes): For a protected operation, transfer finalization list
	to protected body subprogram, to force cleanup actions when needed.
	

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]