aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.cc
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2024-08-22 12:32:00 -0400
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-09-03 10:15:56 +0200
commitb776b08b718feb059fed80b1de6bcf280fd6f03c (patch)
tree69db0d4b5f18377491021f91b4f38a18aceea025 /gcc/fold-const.cc
parent6b1cf59e90d3d6391d61b2a8f77856b5aa044014 (diff)
downloadgcc-b776b08b718feb059fed80b1de6bcf280fd6f03c.zip
gcc-b776b08b718feb059fed80b1de6bcf280fd6f03c.tar.gz
gcc-b776b08b718feb059fed80b1de6bcf280fd6f03c.tar.bz2
ada: Fix Finalize_Storage_Only bug in b-i-p calls
Do not pass null for the Collection parameter when Finalize_Storage_Only is in effect. If the collection is null in that case, we will blow up later when we deallocate the object. gcc/ada/ * exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call): Remove Finalize_Storage_Only from the code that checks whether to pass null to the Collection parameter. Having done that, we don't need to check for Is_Library_Level_Entity, because No_Heap_Finalization requires that. And if we ever change No_Heap_Finalization to allow nested access types, we will still want to pass null. Note that the comment "Such a type lacks a collection." is incorrect in the case of Finalize_Storage_Only; such types have a collection.
Diffstat (limited to 'gcc/fold-const.cc')
0 files changed, 0 insertions, 0 deletions