aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_util.adb
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-05-20 01:23:20 +0200
committerMarc Poulhiès <poulhies@adacore.com>2023-06-15 09:59:37 +0200
commit17e45a14a2043ae2117f772945de32d402e10f3f (patch)
tree8929c6eb7beb651809bc495f6cb195ff64ebe2de /gcc/ada/exp_util.adb
parenta8c45d3fba65fa4e83903ffcba678eb497c2b07b (diff)
downloadgcc-17e45a14a2043ae2117f772945de32d402e10f3f.zip
gcc-17e45a14a2043ae2117f772945de32d402e10f3f.tar.gz
gcc-17e45a14a2043ae2117f772945de32d402e10f3f.tar.bz2
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.
Diffstat (limited to 'gcc/ada/exp_util.adb')
-rw-r--r--gcc/ada/exp_util.adb1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 9195979..0d0ad8a 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -7283,6 +7283,7 @@ package body Exp_Util is
when N_Indexed_Component
| N_Selected_Component
| N_Aggregate
+ | N_Extension_Aggregate
=>
return True;