[PATCH] D66721: [analyzer] Analysis: Prevent bitwise operation false positives

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 25 13:25:16 PDT 2019


NoQ added a comment.

No-no, you're disabling the checkers here but you should be silencing them. This will be crashing because modeling is disabled.

I also recommend checker options, even if they apply to multiple checkers (@Szelethus mentioned that package options are a thing, you might use these if you don't want to make multiple options).



================
Comment at: clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp:82-88
     // Do not report assignments of uninitialized values inside swap functions.
     // This should allow to swap partially uninitialized structs
     // (radar://14129997)
     if (const FunctionDecl *EnclosingFunctionDecl =
         dyn_cast<FunctionDecl>(C.getStackFrame()->getDecl()))
       if (C.getCalleeName(EnclosingFunctionDecl) == "swap")
         return;
----------------
Ugh. This part is also wrong for the same reason.


Repository:
  rC Clang

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

https://reviews.llvm.org/D66721





More information about the cfe-commits mailing list