summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-10-13 11:30:06 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-10-13 11:30:06 +0000
commit2c775709f6c23c691969cc900535b4ce339668c5 (patch)
tree86ba35c9d9e4722b60dce903f6b85e2e04fdf311
parent944a051ebbdd11117e6afaed86f01165f56f3ba9 (diff)
downloadbcm5719-llvm-2c775709f6c23c691969cc900535b4ce339668c5.tar.gz
bcm5719-llvm-2c775709f6c23c691969cc900535b4ce339668c5.zip
BlockInCriticalSectionChecker - silence static analyzer dyn_cast null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, but we should be able to use cast<> directly and if not assert will fire for us. llvm-svn: 374717
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp
index e5b8a6b5ffe..0eb3c3d1d0e 100644
--- a/clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp
@@ -126,7 +126,7 @@ bool BlockInCriticalSectionChecker::isLockFunction(const CallEvent &Call) const
bool BlockInCriticalSectionChecker::isUnlockFunction(const CallEvent &Call) const {
if (const auto *Dtor = dyn_cast<CXXDestructorCall>(&Call)) {
- const auto *DRecordDecl = dyn_cast<CXXRecordDecl>(Dtor->getDecl()->getParent());
+ const auto *DRecordDecl = cast<CXXRecordDecl>(Dtor->getDecl()->getParent());
auto IdentifierInfo = DRecordDecl->getIdentifier();
if (IdentifierInfo == IILockGuard || IdentifierInfo == IIUniqueLock)
return true;
OpenPOWER on IntegriCloud