[clang] [analyzer] Fix false double free when including 3rd-party headers with overloaded delete operator as system headers (PR #85224)
Balázs Kéri via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 19 01:58:48 PDT 2024
================
@@ -1090,7 +1090,8 @@ static bool isStandardNewDelete(const FunctionDecl *FD) {
// If the header for operator delete is not included, it's still defined
// in an invalid source location. Check to make sure we don't crash.
return !L.isValid() ||
- FD->getASTContext().getSourceManager().isInSystemHeader(L);
+ (!FD->hasBody() && // FIXME: Still a false alarm after CTU inlining.
+ FD->getASTContext().getSourceManager().isInSystemHeader(L));
----------------
balazske wrote:
Is it possible to move the check into `checkPostCall`? Then this situation can not happen.
https://github.com/llvm/llvm-project/pull/85224
More information about the cfe-commits
mailing list