]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Bad access checks on if/case expression as actual
authorJustin Squirek <squirek@adacore.com>
Thu, 12 Mar 2020 11:01:43 +0000 (07:01 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 15 Jun 2020 08:04:31 +0000 (04:04 -0400)
commit773e99ac3e61bd84f9848e78e17867a920f9ae53
tree2be9737f01ffa0ed2c05f6d40ffddbad55c9802c
parentfdcbc0764dee19e9e1eeeb17c960567474b4d688
[Ada] Bad access checks on if/case expression as actual

2020-06-15  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* exp_ch4.adb (Expand_N_Case_Expression): Set default value for
Target to silence potential warnings.
(Expand_N_If_Expression): Add calculation to check when the if
expression is used directly in the context of an actual of an
anonymous access type and add a special path to force expansion
of the if expression in this case.
* exp_ch6.adb (Expand_Branch): Generate an assignment to the
level temporary for a given branch.
(Expand_Call_Helper): Add expansion to allow for creating a
temporary to store associated accessiblity levels on each branch
of the conditional expression.  Also perform expansion of
function calls into expressions with actions, and fixup
references to N with Call_Node.
(Insert_Level_Assign): Move through nested conditional
expressions to each branch.
* sem_util.ads, sem_util.adb (Is_Anonymous_Access_Actual): Added
to detect when to force expansion of if expressions.
gcc/ada/exp_ch4.adb
gcc/ada/exp_ch6.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads