baloghadamsoftware created this revision.
baloghadamsoftware added reviewers: NoQ, Szelethus.
baloghadamsoftware added a project: clang.
Herald added subscribers: martong, steakhal, Charusso, gamesh411, dkrupp, 
donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whisperity.

`CheckerRegistry` registers a checker either if it is excplicitly enabled or it 
is a dependency of an explicitly enabled checker and is not explicitly 
disabled. In both cases it is also important that the checker should be 
registered (`shoudRegister`//XXX//`()` returns true).

Currently there is a bug here: if the dependenct checker is not explicitly 
disabled it is registered regardless of whether it should be registered. This 
patch fixes this bug.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75842

Files:
  clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h


Index: clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
===================================================================
--- clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
+++ clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
@@ -166,7 +166,7 @@
     }
 
     bool isDisabled(const LangOptions &LO) const {
-      return State == StateFromCmdLine::State_Disabled && ShouldRegister(LO);
+      return State == StateFromCmdLine::State_Disabled || !ShouldRegister(LO);
     }
 
     // Since each checker must have a different full name, we can identify


Index: clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
===================================================================
--- clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
+++ clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
@@ -166,7 +166,7 @@
     }
 
     bool isDisabled(const LangOptions &LO) const {
-      return State == StateFromCmdLine::State_Disabled && ShouldRegister(LO);
+      return State == StateFromCmdLine::State_Disabled || !ShouldRegister(LO);
     }
 
     // Since each checker must have a different full name, we can identify
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to