================
@@ -48,8 +52,14 @@ static const Expr *getDenomExpr(const ExplodedNode *N) {
 
 void DivZeroChecker::reportBug(StringRef Msg, ProgramStateRef StateZero,
                                CheckerContext &C) const {
+  if (!ChecksEnabled[CK_DivZeroChecker])
+    return;
+  if (!BugTypes[CK_DivZeroChecker])
+    BugTypes[CK_DivZeroChecker].reset(
+        new BugType(CheckNames[CK_DivZeroChecker], "Division by zero"));
----------------
NagyDonat wrote:

It's a pity that we need this lazy dynamic initialization 
:face_with_diagonal_mouth:. We should really introduce a clear framework to 
avoid this. 

https://github.com/llvm/llvm-project/pull/106389
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to