ada: Fix oversight in implementation of allocators for storage models
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 18 Oct 2022 09:32:02 +0000 (11:32 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 8 Nov 2022 08:35:03 +0000 (09:35 +0100)
commitb2278f6b146595b3f80a072145a78877041cb8bc
tree78f57407fc72c37b5db3acf12a88855551bab6ab
parent10f193eb043e30741d9631999bc869d71d43264c
ada: Fix oversight in implementation of allocators for storage models

When the allocator is of an unconstrained array type and has an initializing
expression, the copy of the initializing expression must be done separately
from that of the bounds.

gcc/ada/

* gcc-interface/utils2.cc (build_allocator): For unconstrained
array types with a storage model and an initializing expression,
copy the initialization expression separately from the bounds. In
all cases with a storage model, pass the locally computed size for
the store.
gcc/ada/gcc-interface/utils2.cc