From mboxrd@z Thu Jan 1 00:00:00 1970 From: hjl@lucon.org (H.J. Lu) To: hjl@lucon.org (hjl) Cc: egcs@cygnus.com Subject: Re: A new bug in 971114 Date: Sun, 16 Nov 1997 18:42:00 -0000 Message-id: References: X-SW-Source: 1997-11/msg00538.html > > 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;