This is the mail archive of the gcc@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]

Re: A new bug in 971114


> 
> On linux/x86, with egcs-971114, I got
> 
> /home/work/gnu/bin/egcs/gcc/xgcc -B/home/work/gnu/bin/egcs/gcc/ -c -fthis-is-variable -c foo.cc
> foo.cc: In function `class Int * Proc0()':
> foo.cc:9: Internal compiler error.
> foo.cc:9: Please submit a full bug report to `egcs-bugs@cygnus.com'.
> 
> egcs-971105 is fine.
> 
> 
> -- 
> H.J. Lu (hjl@gnu.ai.mit.edu)
> --
> class Int 
> {
> public: 
>   Int ();
> };
> 
> Int *Proc0()
> {
>    return new Int;
> }
> 

This kludge doesn't even look right to me. But at least, gcc doesn't
dump core now. Could someone please check it out and find a right
fix?

Thanks.


-- 
H.J. Lu (hjl@gnu.ai.mit.edu)
--
Sun Nov 16 18:34:08 1997  H.J. Lu  (hjl@gnu.ai.mit.edu)

	* init.c (build_new): Handle freeing allocated memory when the
	constructor throws only if alloc_expr is not NULL.

Index: init.c
===================================================================
RCS file: /home/work/cvs/gnu/egcs/gcc/cp/init.c,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 init.c
--- init.c	1997/11/14 22:32:47	1.1.1.5
+++ init.c	1997/11/17 02:33:36
@@ -2720,7 +2720,7 @@
 	 new-placement, then the deallocation function is called to free
 	 the memory in which the object was being constructed.  */
       /* FIXME: handle placement delete.  */
-      if (flag_exceptions && ! placement)
+      if (flag_exceptions && ! placement && alloc_expr)
 	{
 	  tree cleanup = alloc_expr;
 


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