diff options
author | Vincent Pucci <pucci@adacore.com> | 2012-07-30 15:12:15 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-07-30 17:12:15 +0200 |
commit | b5059fa0897458f65c8c2a30f3d16c8dbc1e0e03 (patch) | |
tree | 1e514a1830f592673f0fcf04c1f66e2283589aa7 /gcc | |
parent | 5aea1e76a80c9c5770692ece18100b9383cbab3a (diff) | |
download | gcc-b5059fa0897458f65c8c2a30f3d16c8dbc1e0e03.zip gcc-b5059fa0897458f65c8c2a30f3d16c8dbc1e0e03.tar.gz gcc-b5059fa0897458f65c8c2a30f3d16c8dbc1e0e03.tar.bz2 |
sem_ch9.adb (Allows_Lock_Free_Implementation): Restrict implicit dereferences of access values.
2012-07-30 Vincent Pucci <pucci@adacore.com>
* sem_ch9.adb (Allows_Lock_Free_Implementation): Restrict implicit
dereferences of access values.
From-SVN: r189975
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/sem_ch9.adb | 11 |
2 files changed, 12 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d425a70..c87a444 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2012-07-30 Vincent Pucci <pucci@adacore.com> + + * sem_ch9.adb (Allows_Lock_Free_Implementation): Restrict implicit + dereferences of access values. + 2012-07-27 Iain Sandoe <iain@codesourcery.com> * system-darwin-ppc64.ads: Add Support_Atomic_Primitives, set to True. diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb index 1420ba8..c392dcc 100644 --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -411,12 +411,15 @@ package body Sem_Ch9 is return Abandon; - -- Explicit dereferences restricted (i.e. dereferences of - -- access values). + -- Dereferences of access values restricted - elsif Kind = N_Explicit_Dereference then + elsif Kind = N_Explicit_Dereference + or else (Kind = N_Selected_Component + and then Is_Access_Type (Etype (Prefix (N)))) + then if Lock_Free_Given then - Error_Msg_N ("explicit dereference not allowed", N); + Error_Msg_N ("dereference of access value " & + "not allowed", N); return Skip; end if; |