[clang] Fix array bound checker false negative (PR #161723)

Artem Dergachev via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 2 15:47:45 PDT 2025


https://github.com/haoNoQ commented:

Ooo you folks are interested in doing something with this checker too? Nice!!

At a glance it looks like you're trying to turn this checker into an enforcement tool that forces the user to check bounds before every array access. Which is valid but doesn't quite fit with the usual theme of minimizing the noise which is prevalent in our path-sensitive analysis land. So the existing logic actually looks fine to me for what it's supposed to do. These negatives are intentional, they're as true as it gets - for the local, default, highly subjective definition of true/false positives/negatives. I'll explain more in an inline comment.

So you can absolutely do what I think you want to do. But you may need to coexist with the existing logic, like add a checker option to switch it off, or something of that nature.

https://github.com/llvm/llvm-project/pull/161723


More information about the cfe-commits mailing list