[PATCH] D158775: [NFC] Initialize member pointer and avoid potential null dereference

Aaron Puchert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 24 14:17:02 PDT 2023


aaronpuchert added inline comments.


================
Comment at: clang/lib/Analysis/ThreadSafety.cpp:2243
   const auto *CurrentFunction = dyn_cast<FunctionDecl>(D);
   CurrentMethod = dyn_cast<CXXMethodDecl>(D);
 
----------------
It seems to me that `CurrentMethod` is unconditionally assigned a value here, before it is being read anywhere.


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