diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2022-02-04 20:56:51 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-05-12 12:38:35 +0000 |
commit | bb1c939d9b800ef9aadf8a82cbafdfae5c88210c (patch) | |
tree | abb5e53e3d3edd9b03d5807b6ed88d04c39d9cb5 /gcc/ada/gcc-interface/utils.cc | |
parent | 7a60ba4c831a6d5e0d58cdfa64ddcb7c6ac09835 (diff) | |
download | gcc-bb1c939d9b800ef9aadf8a82cbafdfae5c88210c.zip gcc-bb1c939d9b800ef9aadf8a82cbafdfae5c88210c.tar.gz gcc-bb1c939d9b800ef9aadf8a82cbafdfae5c88210c.tar.bz2 |
[Ada] Fix scope of block in expanded protected entry body
We expand protected entry body into procedure with a nested block. The
scope of this block is naturally the enclosing procedure. However, the
scope field was wrongly set to the entity of the enclosing procedure
body (i.e. E_Subprogram_Body); now it is set to the entity of the
enclosing procedure spec (i.e. E_Procedure).
In general, the scope field should always points to spec, even for
entities that are syntactically nested within a program unit body. The
scope set to E_Subprogram_Body entity was only accepted because in gigi
we had a protection for that, but this protection is now removed.
This patch fixes a regression in a ravenscar testsuite test (c_rf02_06),
where GNAT was crashing when compiling in configurable runtime mode with
restriction No_Exception_Propagation.
gcc/ada/
* exp_ch9.adb (Build_Protected_Entry): Set scope of the nested
block to spec and not the body of the procedure created for a
protected entry.
Diffstat (limited to 'gcc/ada/gcc-interface/utils.cc')
0 files changed, 0 insertions, 0 deletions