From: Gary Dismukes Date: Wed, 5 Aug 2020 20:29:30 +0000 (-0400) Subject: [Ada] Compiler crash on prefixed call to controlled function with invariant check X-Git-Tag: upstream/12.2.0~12794 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05eb5c6142c9406666c97c588ff2c9bdc1706562;p=platform%2Fupstream%2Fgcc.git [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. --- 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