aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorGary Dismukes <dismukes@adacore.com>2020-08-05 16:29:30 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-21 03:22:46 -0400
commit05eb5c6142c9406666c97c588ff2c9bdc1706562 (patch)
treeaed7dd5707ae3eaecb66110a68808f738c0463a0 /gcc/ada
parent5ff5f7210f74f3190ec50b526a0dfb5be462b28b (diff)
downloadgcc-05eb5c6142c9406666c97c588ff2c9bdc1706562.zip
gcc-05eb5c6142c9406666c97c588ff2c9bdc1706562.tar.gz
gcc-05eb5c6142c9406666c97c588ff2c9bdc1706562.tar.bz2
[Ada] Compiler crash on prefixed call to controlled function with invariant check
gcc/ada/ * exp_ch6.adb (Insert_Post_Call_Actions): Test for N_Explicit_Dereference as part of the existing test for function calls.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/exp_ch6.adb3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index 7b50812..b04d1c0 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -8360,9 +8360,12 @@ package body Exp_Ch6 is
-- The write-back of (in)-out parameters is handled by the back-end,
-- but the constraint checks generated when subtypes of formal and
-- actual don't match must be inserted in the form of assignments.
+ -- Also do this in the case of explicit dereferences, which can occur
+ -- due to rewritings of function calls with controlled results.
if Nkind (N) = N_Function_Call
or else Nkind (Original_Node (N)) = N_Function_Call
+ or else Nkind (N) = N_Explicit_Dereference
then
pragma Assert (Ada_Version >= Ada_2012);
-- Functions with '[in] out' parameters are only allowed in Ada