[PATCH] D54438: [analyzer] Reimplement dependencies between checkers

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 28 05:45:48 PST 2019


Szelethus marked an inline comment as done.
Szelethus added inline comments.


================
Comment at: cfe/trunk/include/clang/StaticAnalyzer/Checkers/Checkers.td:230
 
 def NullReturnedFromNonnullChecker : Checker<"NullReturnedFromNonnull">,
   HelpText<"Warns when a null pointer is returned from a function that has "
----------------
uabelho wrote:
> Any reason this checker shouldn't get a dependecy too?
> 
> If I run it with
> 
>  clang -cc1 -analyze -analyzer-checker=core -analyzer-checker=nullability.NullReturnedFromNonnull empty.c
> 
> on an empty file empty.c I get
> 
> clang: ../tools/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h:171: CHECKER *clang::ento::CheckerManager::getChecker() [CHECKER = (anonymous namespace)::NullabilityChecker]: Assertion `CheckerTags.count(tag) != 0 && "Requested checker is not registered! Maybe you should add it as a " "dependency in Checkers.td?"' failed.
> 
> If I add
>  Dependencies<[NullabilityBase]>,
> to it, then it doesn't trigger the assert.
> 
> I don't know anything about this code, what do you think about it?
Yup, should be there. Thanks for catching this one! I'll be able to commit the fix in about 4ish hours, or if it blocks you, feel free to so before that.

Since I didnt add test for each and every affected checker, I wonder whether there is any more of these that I forgot/messed up while rebasing.

Thanks again! :)


Repository:
  rL LLVM

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

https://reviews.llvm.org/D54438





More information about the cfe-commits mailing list