Bug in egcs 1.1 -fno-rtti + exception = segfault
Alexandre Oliva
oliva@dcc.unicamp.br
Sat Oct 31 14:18:00 GMT 1998
On Oct 29, 1998, Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de> wrote:
>> >> typeid (* (int*) 0);
> [...]
>> ... which is ok, since dereferencing a NULL pointer leads to undefined
>> behavior.
> Not in this case. [expr.typeid] says:
>>> If the lvalue expression is obtained by applying the unary *
>>> operator to a pointer 62) and the pointer is a null pointer value
>>> (4.10), the typeid expression throws the bad_typeid exception
>>> (18.5.3).
Not in this case. This item refers to polymorphic classes only, which
`int' isn't. In this case, the expression is equivalent to
typeid(int).
--
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