[PATCH] D79330: [Analyzer][VLASizeChecker] Check for VLA size overflow.

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 13 11:25:17 PDT 2020


Szelethus accepted this revision.
Szelethus added a comment.
This revision is now accepted and ready to land.

In D79330#2034414 <https://reviews.llvm.org/D79330#2034414>, @martong wrote:

> I am not sure if I can follow your concern here.
>  `sizeof(size_t)` is typically 8, so that is not a bug, neither a code smell to have `char VLA[sizeof(size_t)];`. The problem is when the size is bigger than the maximum value of `size_t`, that ix 0xff...ff, as we can see that in the new tests.
>  Besides, not having the size printed out in the warning is not a blocker for me, this looks good enough.


Silly me. The size would be nice, but if we don't explain how we calculated that size, it wouldn't make the bug report much better.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79330





More information about the cfe-commits mailing list