This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C++ PATCH for infinite recursion in C++ front-end



This patch fixes an infinite recursion in cvt.c reported a couple of
days ago.

-- 
Mark Mitchell 			mark@markmitchell.com
Mark Mitchell Consulting	http://www.markmitchell.com

1998-10-09  Mark Mitchell  <mark@markmitchell.com>

	* cvt.c (ocp_convert): Avoid infinite recursion caused by
	1998-10-03 change.

Index: cvt.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/cvt.c,v
retrieving revision 1.34
diff -c -p -r1.34 cvt.c
*** cvt.c	1998/10/04 11:36:25	1.34
--- cvt.c	1998/10/09 17:28:25
*************** ocp_convert (type, expr, convtype, flags
*** 679,690 ****
  	/* 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.  */
! 	;
        else
! 	e = build1 (NOP_EXPR, type, e);
! 
!       return fold (e);
      }
  
    if (code == VOID_TYPE && (convtype & CONV_STATIC))
--- 679,690 ----
  	/* 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.  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
! 	return fold (build1 (NOP_EXPR, type, e));
      }
  
    if (code == VOID_TYPE && (convtype & CONV_STATIC))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]