This is the mail archive of the gcc-cvs@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]

r260532 - in /trunk/gcc: ada/ChangeLog ada/exp_...


Author: pmderodat
Date: Tue May 22 13:26:55 2018
New Revision: 260532

URL: https://gcc.gnu.org/viewcvs?rev=260532&root=gcc&view=rev
Log:
[Ada] Crash on partial initialization of controlled component

This patch modifies the late expansion of record aggregates to ensure that the
generated code which handles a controlled component initialized by a function
call is inserted in line with the rest of the initialization code, rather than
before the record aggregate. This way the function call has proper access to
the discriminants of the object being created.

2018-05-22  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

	* exp_aggr.adb (Initialize_Ctrl_Record_Component): Insert the generated
	code for a transient component in line with the rest of the
	initialization code, rather than before the aggregate. This ensures
	that the component has proper visibility of the discriminants.

gcc/testsuite/

	* gnat.dg/controlled8.adb: New testcase.

Added:
    trunk/gcc/testsuite/gnat.dg/controlled8.adb
Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/exp_aggr.adb
    trunk/gcc/testsuite/ChangeLog


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