[clang] [clang][analyzer] Check initialization and argument passing in FixedAddressChecker (PR #110977)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 7 18:25:11 PST 2024


NagyDonat wrote:

@balazske As we discussed in person, I think you switch to detecting _dereference_ of fixed addresses (instead of extending the current "store of fixed address in pointer value" model e.g. by the commit under review).

I think you should briefly look at DereferenceChecker and check whether you can reuse some of its code (to avoid code duplication), but according to Viktor Cseh it would be difficult to adapt that checker for detecting fixed address dereference (instead of null pointer dereference), so don't be surprised if you don't see any opportunities.

I hope that this new direction could significantly reduce the amount of false positives produced by this checker. (There are some situations where it's reasonable to store a concrete integer in a pointer variable, and then later convert it back to an integer; while dereferencing a concrete integer is a serious bug unless the project is very low-level.)

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


More information about the cfe-commits mailing list