[PATCH] D51866: [analyzer][UninitializedObjectChecker] New flag to ignore guarded uninitialized fields

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 29 16:16:17 PST 2018


NoQ added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp:502
+
+  auto AssertM = callExpr(callee(functionDecl(hasName("assert"))));
+  auto GuardM =
----------------
Szelethus wrote:
> Szelethus wrote:
> > NoQ wrote:
> > > In a lot of standard libraries `assert()` is implemented as a macro. You might want to catch the corresponding builtin or look at macro names (not sure if we have a matcher for the latter but it should be easy to add).
> > Hmm, maybe go for `[[noreturn]]` functions?
> Unfortunately, macros are not a part of the AST, so I'm struggling a lot with this patch, but I'm making progress.
Maybe `[[noreturn]]` or just catch specific builtins such as `__assert_fail` - see what `NoReturnFunctionChecker` reacts to.


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

https://reviews.llvm.org/D51866





More information about the cfe-commits mailing list