[PATCH] D71714: [Sema] Fix -Warray-bounds false negative when casting an out-of-bounds array item

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 19 17:14:41 PST 2019


efriedma added a comment.

To be rigorous, we should perform "pointer" checking for every operation that performs pointer arithmetic.  Then we should perform "lvalue" checking (which doesn't allow pointers one past the end) in the following places:

1. When we take the address of an lvalue.
2. When we form a reference to an lvalue.
3. When we perform an lvalue-to-rvalue conversion.
4. When we perform an assignment to an lvalue.

This sort of piecemeal approach of recursively looking through arbitrary expressions seems likely to miss cases.  For example, we currently don't perform checks inside compound literals.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71714





More information about the cfe-commits mailing list