This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: New pass to delete unexecutable paths in the CFG


>>>>> "Jeff" == Jeff Law <law@redhat.com> writes:

Jeff> First, it's perfectly fine to have a NULL pointer dereference in a
Jeff> program as long as that code is never executed.  Once the code is
Jeff> executed, we've entered the realm of undefined behavior.

Jeff> Thus in a conforming program we can safely assume that a provable NULL
Jeff> pointer dereference can never be executed at runtime.  This implies
Jeff> there is a path through the CFG that is unexecutable.

IIUC, then this isn't true for Java.  In Java the attempt to dereference
NULL throws a NullPointerException, which can be caught, etc.  It isn't
undefined.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]