Skip to content

Commit 0226494

Browse files
committed
Simplify code, add assert
1 parent d3e8f1f commit 0226494

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

clang/lib/StaticAnalyzer/Core/CallEvent.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -756,11 +756,8 @@ const CXXRecordDecl *CXXInstanceCall::getDeclForDynamicType() const {
756756
if (!DynType.isValid())
757757
return nullptr;
758758

759-
QualType Ty = DynType.getType()->getPointeeType();
760-
if (Ty.isNull())
761-
return nullptr;
762-
763-
return Ty->getAsCXXRecordDecl();
759+
assert(!DynType.getType()->getPointeeType().isNull());
760+
return DynType.getType()->getPointeeCXXRecordDecl();
764761
}
765762

766763
RuntimeDefinition CXXInstanceCall::getRuntimeDefinition() const {

0 commit comments

Comments
 (0)