[PATCH] D152275: Use memory region declaration intrinsic when generating code for array subscripts

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 15 14:04:27 PDT 2023


efriedma added a comment.

In D152275#4423845 <https://reviews.llvm.org/D152275#4423845>, @simeon wrote:

>> - User code might not actually obey the language rules; do we have any sanitizer that checks if user code trips over this?
>
> I believe AddressSanitizer <https://clang.llvm.org/docs/AddressSanitizer.html> should be able to detect out-of-bounds accesses.

asan will detect if you index completely outside a memory allocation, but it won't detect if you do something like `struct S { int x[10]; int y; } s = {}; return s->x[10];`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152275



More information about the cfe-commits mailing list