public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
[parent not found: <347B076D.6F1CEC10.cygnus.egcs.bugs@zaphod.wh9.tu-dresden.de>]
* EH unwind bug
@ 1997-11-25 16:09 Thomas Weise
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Weise @ 1997-11-25 16:09 UTC (permalink / raw)
  To: egcs

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 <iostream.h>

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;
}

^ permalink raw reply	[flat|nested] 7+ messages in thread
* EH unwind bug
@ 1997-11-25  8:14 Thomas Weise
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Weise @ 1997-11-25  8:14 UTC (permalink / raw)
  To: egcs-bugs; +Cc: egcs

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.
I hope it 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 <iostream.h>

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;
}

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1997-12-03  8:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <347B307E.80D08A44.cygnus.egcs@zaphod.wh9.tu-dresden.de>
1997-11-26  6:10 ` EH unwind bug Jason Merrill
     [not found] <347B076D.6F1CEC10.cygnus.egcs.bugs@zaphod.wh9.tu-dresden.de>
     [not found] ` <u9btz0cs9q.fsf@yorick.cygnus.com>
1997-12-02  9:56   ` Thomas Weise
1997-12-03  0:21     ` Jason Merrill
1997-12-03  5:46       ` Thomas Weise
1997-12-03  8:23         ` Jeffrey A Law
1997-11-25 16:09 Thomas Weise
  -- strict thread matches above, loose matches on Subject: below --
1997-11-25  8:14 Thomas Weise

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).