aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@markmitchell.com>1998-10-09 10:32:01 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1998-10-09 10:32:01 +0000
commit953360c8154de41a68df71e5476557a0154ed1fb (patch)
treed6fa7684a97843a1370c19c3544eddef734d1327
parent297a6bfc7005b8a217b6f33dc7b781f778795a85 (diff)
downloadgcc-953360c8154de41a68df71e5476557a0154ed1fb.zip
gcc-953360c8154de41a68df71e5476557a0154ed1fb.tar.gz
gcc-953360c8154de41a68df71e5476557a0154ed1fb.tar.bz2
cvt.c (ocp_convert): Avoid infinite recursion caused by 1998-10-03 change.
* cvt.c (ocp_convert): Avoid infinite recursion caused by 1998-10-03 change. From-SVN: r22958
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/cvt.c10
2 files changed, 10 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7ef415c..b781ad1 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+1998-10-09 Mark Mitchell <mark@markmitchell.com>
+
+ * cvt.c (ocp_convert): Avoid infinite recursion caused by
+ 1998-10-03 change.
+
1998-10-08 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (resolve_overloaded_unification): New fn.
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index f2b41d80..50c4fc5 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -679,12 +679,12 @@ ocp_convert (type, expr, convtype, flags)
/* The call to fold will not always remove the NOP_EXPR as
might be expected, since if one of the types is a typedef;
the comparsion in fold is just equality of pointers, not a
- call to comptypes. */
- ;
+ call to comptypes. We don't call fold in this case because
+ that can result in infinite recursion; fold will call
+ convert, which will call ocp_convert, etc. */
+ return e;
else
- e = build1 (NOP_EXPR, type, e);
-
- return fold (e);
+ return fold (build1 (NOP_EXPR, type, e));
}
if (code == VOID_TYPE && (convtype & CONV_STATIC))