]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix too small secondary stack allocation for returned conversion
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 19 May 2023 23:23:20 +0000 (01:23 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 15 Jun 2023 07:59:37 +0000 (09:59 +0200)
commit17e45a14a2043ae2117f772945de32d402e10f3f
tree8929c6eb7beb651809bc495f6cb195ff64ebe2de
parenta8c45d3fba65fa4e83903ffcba678eb497c2b07b
ada: Fix too small secondary stack allocation for returned conversion

The previous fix did not address a latent issue whereby the allocation
would be made using the (static) subtype of the conversion instead of
the (dynamic) subtype of the return object, so this change rewrites the
code responsible for determining the type used for the allocation, and
also contains a small improvement to the Has_Tag_Of_Type predicate.

gcc/ada/

* exp_ch3.adb (Make_Allocator_For_Return): Rewrite the logic that
determines the type used for the allocation and add assertions.
* exp_util.adb (Has_Tag_Of_Type): Also return true for extension
aggregates.
gcc/ada/exp_ch3.adb
gcc/ada/exp_util.adb