[PATCH] D78853: [Sema] Fix null pointer dereference warnings [1/n]

Mandeep Singh Grang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 27 13:28:12 PDT 2020


mgrang added a comment.

In D78853#2003866 <https://reviews.llvm.org/D78853#2003866>, @efriedma wrote:

> Please don't add null checks for pointers that can't be null.  It makes the code slower and harder to understand.  And least one of the checks you added is actively breaking the code.
>
> In some cases, the analysis is pointing to cases where the code could be made more clear for both humans and machines with some refactoring or assertions.  Patches welcome, but please make sure any assertions properly explain the invariant. And please split the patches up a bit more; adding assertions for complex invariants in ten different unrelated places is more than I really want to review at once.
>
> (Also, a reminder, please post patches with full context.)


Thanks @efriedma. Will split up the patches into smaller chunks and also post with full context.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78853/new/

https://reviews.llvm.org/D78853





More information about the cfe-commits mailing list