This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: EH in egcs
- To: hjl at lucon dot org (H.J. Lu)
- Subject: Re: EH in egcs
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 26 Oct 1997 23:45:09 -0200
- Cc: jason at cygnus dot com (Jason Merrill), egcs at cygnus dot com
- References: <m0xPcw9-0004edC@ocean.lucon.org>
H J Lu writes:
> How come there are multiple uncaught exceptions active at the
> same time?
The following code fragment introduces two active uncaught exceptions.
The `throw 1' expression causes the bar object to be destructed.
While its destructor is being run, another exception is thrown. If
this exception were not caught, terminate would have been called.
Anyway, there can be more than one pending exception, as long as they
do not propagate outside the destructor called by the stack-unwinding
mechanism.
struct foo {
~foo() {
try { throw 2; }
catch(int) {}
}
};
main() {
try { foo bar; throw 1; }
catch(int) {}
}
> I assume we are not talking about multithreading.
That's another issue.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil