[Ada] Spurious tampering check failure
authorHristian Kirtchev <kirtchev@adacore.com>
Thu, 31 May 2018 10:46:48 +0000 (10:46 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 31 May 2018 10:46:48 +0000 (10:46 +0000)
commit3c5d07ab057a1cbe23ca655d172bfb53581be960
tree4f8b88b82317629d19adaee152802d2727c26189
parent9977c78567279b5f44106394a79466cec0e7ca7c
[Ada] Spurious tampering check failure

This patch modifies the transient scope mechanism to create a scope when the
condition of an iteration scheme returns a controlled result or involves the
secondary stack. As a result, a while loop which iterates over a container
properly manages the tampering bit at each iteration of the loop.

2018-05-31  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* exp_ch7.adb (Find_Transient_Context): An iteration scheme is a valid
boudary for a transient scope.

gcc/testsuite/

* gnat.dg/tampering_check1.adb, gnat.dg/tampering_check1_ivectors.ads,
gnat.dg/tampering_check1_trim.adb, gnat.dg/tampering_check1_trim.ads:
New testcase.

From-SVN: r261006
gcc/ada/ChangeLog
gcc/ada/exp_ch7.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/tampering_check1.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/tampering_check1_ivectors.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/tampering_check1_trim.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/tampering_check1_trim.ads [new file with mode: 0644]