Endre =?utf-8?q?Fülöp?= <endre.fu...@sigmatechnology.se>, Endre =?utf-8?q?Fülöp?= <endre.fu...@sigmatechnology.se>, Endre =?utf-8?q?Fülöp?= <endre.fu...@sigmatechnology.se>, Endre =?utf-8?q?Fülöp?= <endre.fu...@sigmatechnology.se>, Endre =?utf-8?q?Fülöp?= <endre.fu...@sigmatechnology.se>, Endre =?utf-8?q?Fülöp?= <endre.fu...@sigmatechnology.se> Message-ID: In-Reply-To: <llvm/llvm-project/pull/67663/cl...@github.com>
================ @@ -25,19 +25,36 @@ using namespace clang; using namespace ento; + namespace { + class InvalidPtrChecker : public Checker<check::Location, check::BeginFunction, check::PostCall> { private: - BugType BT{this, "Use of invalidated pointer", categories::MemoryError}; + static const BugType *InvalidPtrBugType; + // For accurate emission of NoteTags, the BugType of this checker should have + // a unique address. + void InitInvalidPtrBugType() { + InvalidPtrBugType = new BugType(this, "Use of invalidated pointer", + categories::MemoryError); + } ---------------- DonatNagyE wrote: As we discussed in person, this tricky initialization is not needed. I'm fairly sure that checkers like `InvalidPtrChecker` are singletons and they'll have only one unique instance during the whole analysis. Keep the old non-`static` data member and use its address as the unique identifier. https://github.com/llvm/llvm-project/pull/67663 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits