projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f0f4452
)
[clang][sema] checkNoThrow - use cast<> instead of dyn_cast<> to avoid dereference...
author
Simon Pilgrim
<llvm-dev@redking.me.uk>
Sat, 12 Feb 2022 11:18:49 +0000
(11:18 +0000)
committer
Simon Pilgrim
<llvm-dev@redking.me.uk>
Sat, 12 Feb 2022 11:18:49 +0000
(11:18 +0000)
The pointer is referenced immediately, so assert the cast is correct instead of returning nullptr
clang/lib/Sema/SemaCoroutine.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/Sema/SemaCoroutine.cpp
b/clang/lib/Sema/SemaCoroutine.cpp
index
aae90c4
..
71fcf4a
100644
(file)
--- a/
clang/lib/Sema/SemaCoroutine.cpp
+++ b/
clang/lib/Sema/SemaCoroutine.cpp
@@
-680,7
+680,7
@@
static void checkNoThrow(Sema &S, const Stmt *E,
QualType::DestructionKind::DK_cxx_destructor) {
const auto *T =
cast<RecordType>(ReturnType.getCanonicalType().getTypePtr());
- checkDeclNoexcept(
dyn_
cast<CXXRecordDecl>(T->getDecl())->getDestructor(),
+ checkDeclNoexcept(cast<CXXRecordDecl>(T->getDecl())->getDestructor(),
/*IsDtor=*/true);
}
} else