]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Crash due to missing freeze nodes in transient scope
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 Jul 2019 13:34:25 +0000 (13:34 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 Jul 2019 13:34:25 +0000 (13:34 +0000)
commit0dae8dc23d5a55e9fe8cf4f188ab6f1391226bc8
tree82da28faf0e0f626407d351e1a5922e445560637
parent487da8fffa21e6446d162f6639eba7c7fb62f703
[Ada] Crash due to missing freeze nodes in transient scope

The following patch updates the freezing of expressions to insert the
generated freeze nodes prior to the expression that produced them when
the context is a transient scope within a type initialization procedure.
This ensures that the nodes are properly interleaved with respect to the
constructs that generated them.

2019-07-01  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* freeze.adb (Freeze_Expression): Remove the horrible useless
name hiding of N. Insert the freeze nodes generated by the
expression prior to the expression when the nearest enclosing
scope is transient.

gcc/testsuite/

* gnat.dg/freezing1.adb, gnat.dg/freezing1.ads,
gnat.dg/freezing1_pack.adb, gnat.dg/freezing1_pack.ads: New
testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272854 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/ChangeLog
gcc/ada/freeze.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/freezing1.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/freezing1.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/freezing1_pack.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/freezing1_pack.ads [new file with mode: 0644]