[Ada] ACATS 4.1G - C760A02 - Near infinite finalization
authorJavier Miranda <miranda@adacore.com>
Thu, 30 Apr 2020 15:55:42 +0000 (11:55 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 19 Jun 2020 08:17:18 +0000 (04:17 -0400)
commit7841c99268adfaba9c30be23ce7569c85cae52dc
treecdf40bce5eae4592adda8302ff4e15b39ff7a3fc
parentb6c2ec499709f26af66a5327b1ff0ee345f5fa87
[Ada] ACATS 4.1G - C760A02 - Near infinite finalization

2020-06-19  Javier Miranda  <miranda@adacore.com>

gcc/ada/

* exp_ch3.ads (Ensure_Activation_Chain_And_Master): New
subprogram.
* exp_ch3.adb (Ensure_Activation_Chain_And_Master): New
subprogram that factorizes code.
(Expand_N_Object_Declaration): Call new subprogram.
* sem_ch6.adb (Analyze_Function_Return): Returning a
build-in-place unconstrained array type defer the full analysis
of the returned object to avoid generating the corresponding
constrained subtype; otherwise the bounds would be created in
the stack and a dangling reference would be returned pointing to
the bounds.
gcc/ada/exp_ch3.adb
gcc/ada/exp_ch3.ads
gcc/ada/sem_ch6.adb