[PATCH] D158775: [NFC] Initialize member pointer and avoid potential null dereference
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 25 05:11:31 PDT 2023
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM though I can take or leave the changes to ThreadSafety.cpp.
================
Comment at: clang/lib/Analysis/ThreadSafety.cpp:2243
const auto *CurrentFunction = dyn_cast<FunctionDecl>(D);
CurrentMethod = dyn_cast<CXXMethodDecl>(D);
----------------
aaronpuchert wrote:
> It seems to me that `CurrentMethod` is unconditionally assigned a value here, before it is being read anywhere.
It is, but this isn't the `ThreadSafetyAnalyzer` constructor, so there's a window for misuse. So I think this is a false positive, but still a reasonable enough change to make.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D158775/new/
https://reviews.llvm.org/D158775
More information about the cfe-commits
mailing list