diff options
author | Ed Schonberg <schonberg@adacore.com> | 2013-07-05 10:52:13 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@adacore.com> | 2013-07-05 10:52:13 +0000 |
commit | 193c5ebab74b75baa59a7c7a27dd7b3a9153c84c (patch) | |
tree | 8553dce599017e8d0a53a5bad4d1e829bd94e17e | |
parent | 7b8e964f4a52bde83d05db03cd1023116ab90019 (diff) |
2013-07-05 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb (Analyze_Aspect_Specifications): For
pre/postconditions copy the expression to the generated pragma,
to avoid sharing between the original aspect and the pragma node,
because in ASIS_Mode both will be independently analyzed.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@200710 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ada/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/ada/sem_ch13.adb | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 24b3fd28fed..6bec4e805d0 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,12 @@ 2013-07-05 Ed Schonberg <schonberg@adacore.com> + * sem_ch13.adb (Analyze_Aspect_Specifications): For + pre/postconditions copy the expression to the generated pragma, + to avoid sharing between the original aspect and the pragma node, + because in ASIS_Mode both will be independently analyzed. + +2013-07-05 Ed Schonberg <schonberg@adacore.com> + * exp_ch3.adb (Build_Variant_Record_Equality): Add pairs of formals for each discriminant of an unchecked union. (Make_Eq_Case): Suprogram accepts a list of discriminants. Nested diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 1496912cdb4..0eb18f1a9db 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -1799,13 +1799,16 @@ package body Sem_Ch13 is end loop; end if; - -- Build the precondition/postcondition pragma + -- Build the precondition/postcondition pragma. We copy + -- the expression to avoid sharing between the original + -- aspect and the pragma node, because in ASIS_Mode both + -- will be independently analyzed. Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Eloc, Chars => Name_Check, - Expression => Relocate_Node (Expr))), + Expression => New_Copy_Tree (Expr))), Pragma_Name => Pname); -- Add message unless exception messages are suppressed |