Bug in egcs 1.1 -fno-rtti + exception = segfault

Alexandre Oliva oliva@dcc.unicamp.br
Thu Oct 29 02:11:00 GMT 1998


Jason Merrill <jason@cygnus.com> writes:

>>>>>> Valentin Bonnard <bonnardv@pratique.fr> writes:
>>> They don't need each other.  Exceptions need rtti, but the converse
>>> does not hold.

>> Hum. What about:

>> typeid (* (int*) 0);

>> is it undefined behaviour or abort or does it print "Sorry 
>> exceptions are disabled" ?

> It calls __throw_bad_typeid, which throws, and since you didn't compile the
> throwing code with EH support, calls terminate and aborts.

... which is ok, since dereferencing a NULL pointer leads to undefined
behavior.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:oliva@gnu.org mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil




More information about the Gcc-bugs mailing list