On Mon, Nov 7, 2011 at 4:43 PM, Jeff Law <l...@redhat.com> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 11/07/11 06:53, Tom Tromey wrote: >>>>>>> "Jeff" == Jeff Law <l...@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. > So, presumably there's no way to know we're throwing to > NullPointerException from the exception information attached to the > statement or BB? If not I could disable if the statement with the > memory op throws anywhere. It's not ideal, but conservatively correct.
Well, stmt_could_throw_p says that (java has non-call exceptions). OTOH I'm not sure we want to change a possible trap (And thus program abort) to a fallthru ... Richard.