Name: mf23781 Date: 03/10/98
This is a bug seen by looking at the source code.
In src/unix/net/socket.c in JDK 1.1.4 there is
a macro called NET_ERROR() defined.
The definition is as follows:
============================================
#define NET_ERROR(_ee, _ex, _msg) if (!exceptionOccurred(EE())) SignalError(_ee, _ex, _msg)
============================================
This is prone to the classic macro bug of wrong binding
to the "else" in an "if() else" clause if curly braces are
not used:
if (predicate)
NET_ERROR();
else
somethingElse();
The else binds to the if() of the macro which is not intended.
There are several instances where there this occurs in
socket.c eg in
java_net_PlainSocketImpl_socketAccept() for one.
NET_ERROR() should either be defined protectively eg
with "do { } while (0)" construct, or all using instances
should ensure curly braces.
======================================================================