From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Weise To: egcs@cygnus.com Subject: EH unwind bug Date: Tue, 25 Nov 1997 16:09:00 -0000 Message-id: <347B307E.80D08A44@zaphod.wh9.tu-dresden.de> X-SW-Source: 1997-11/msg00832.html egcs-2.90.18, i486-pc-linux-gnulibc1, libc-5.4.39 After latest EH fixes I've finally managed to provide a testcase for the EH bug I've already reported. Building and runnings attached program gives following: tom@hermes:/home/tom > g++ -v Reading specs from /usr/local/lib/gcc-lib/i486-pc-linux-gnulibc1/egcs-2.90.18/specs gcc version egcs-2.90.18 971122 (gcc2-970802 experimental) tom@hermes:/home/tom > g++ bug.cc tom@hermes:/home/tom > a.out stackObj::~stackObj() stackObj::~stackObj() IOT trap/Abort This is, the local object's destructor is executed twice, before the exception raiser's destructor and again after raising the exception. Using -fsjlj-exceptions is fine. I hope this testcase comes in time and can be fixed before release. Tom. -- Thomas Weise, http://www.inf.tu-dresden.de/~tw4 Dresden University of Technology, Department of Computer Science #include class myExc { }; class myExcRaiser { public: ~myExcRaiser(); }; class stackObj { public: ~stackObj() { cout << "stackObj::~stackObj()" << endl; }; }; myExcRaiser::~myExcRaiser() { throw myExc(); } int test() { myExcRaiser rais; stackObj obj; return 0; } int main() { try { test(); } catch (myExc &) { //cout << "caught myExc as expected\n"; } cout << "SUCCESS" << endl; return 0; }