aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch3.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-10-01 10:14:49 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2012-10-01 10:14:49 +0200
commit8e983d807e96f2b993e1bc840c915c8f461077d4 (patch)
tree6f0271e566e17f424763b6a9433eabc8f59c42de /gcc/ada/exp_ch3.adb
parent7246b890962539d475f0f4737c4e87be6f197be9 (diff)
downloadgcc-8e983d807e96f2b993e1bc840c915c8f461077d4.zip
gcc-8e983d807e96f2b993e1bc840c915c8f461077d4.tar.gz
gcc-8e983d807e96f2b993e1bc840c915c8f461077d4.tar.bz2
[multiple changes]
2012-10-01 Thomas Quinot <quinot@adacore.com> * gnatcmd.adb, make.adb (Scan_Make_Arg, Inspect_Switches): Recognize and reject an invalid parameter passed to -vP. 2012-10-01 Yannick Moy <moy@adacore.com> * sem_warn.adb (Check_Infinite_Loop_Warning/Test_Ref): Improve the detection of modifications to the loop variable by noting that, if the type of variable is elementary and the condition does not contain a function call, then the condition cannot be modified by side-effects from a procedure call. 2012-10-01 Robert Dewar <dewar@adacore.com> * checks.adb: Add comments. 2012-10-01 Javier Miranda <miranda@adacore.com> * exp_ch3.adb (Expand_N_Object_Declaration): Improve condition catching never-ending recursion. The previous condition erroneously disabled silently the expansion of the class-wide interface object initialization in cases not involving the recursion. From-SVN: r191892
Diffstat (limited to 'gcc/ada/exp_ch3.adb')
-rw-r--r--gcc/ada/exp_ch3.adb11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 066b37d..b43dfd8 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -4910,8 +4910,15 @@ package body Exp_Ch3 is
-- Expr's type, both types share the same dispatch table and there is
-- no need to displace the pointer.
- elsif Comes_From_Source (N)
- and then Is_Interface (Typ)
+ elsif Is_Interface (Typ)
+
+ -- Avoid never-ending recursion because if Equivalent_Type is set
+ -- then we've done it already and must not do it again!
+
+ and then not
+ (Nkind (Object_Definition (N)) = N_Identifier
+ and then
+ Present (Equivalent_Type (Entity (Object_Definition (N)))))
then
pragma Assert (Is_Class_Wide_Type (Typ));