On Fri, Feb 19, 2016 at 03:12:29AM +0100, Kevin Kofler wrote:
> Jakub Jelinek wrote:
> > ASSERT(this) is pointless, it is testing if undefined behavior didn't
> > happen after the fact, that is just too late.  As I said, use
> > -fsanitize=undefined to make sure you don't call methods on nullptr.
> 
> Doesn't -fno-delete-null-pointer-checks make such ASSERTs work (and also 
> explicit "if (this)" type checks)? I read that that flag fixes programs 
> which rely on "if (this)" checks.

That switch allows to work around buggy programs, at the cost of optimizing
them less, yes.  In any case, such programs should be fixed, this must be
always non-NULL, methods can't be called on NULL pointers.

        Jakub
--
devel mailing list
devel@lists.fedoraproject.org
http://lists.fedoraproject.org/admin/lists/devel@lists.fedoraproject.org

Reply via email to