summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-09-05 17:11:22 +0000
committerJordan Rose <jordan_rose@apple.com>2012-09-05 17:11:22 +0000
commitd1a08b6e43761ac7f4b38297a271c7320577aacd (patch)
tree02be68f71bc4a25a25a4c5a1beb31ec9bc1d64c7 /clang/lib/StaticAnalyzer/Core/CallEvent.cpp
parentbc009d4493838a4cd7b6a642ab81e0b1bb7d2055 (diff)
downloadbcm5719-llvm-d1a08b6e43761ac7f4b38297a271c7320577aacd.tar.gz
bcm5719-llvm-d1a08b6e43761ac7f4b38297a271c7320577aacd.zip
[analyzer] Clean up a couple uses of getPointeeType().
No intended functionality change. llvm-svn: 163219
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/CallEvent.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/CallEvent.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
index aed0f55982a..9a2ec0f9c6b 100644
--- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
+++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
@@ -61,7 +61,7 @@ static bool isCallbackArg(SVal V, QualType T) {
// Check if a callback is passed inside a struct (for both, struct passed by
// reference and by value). Dig just one level into the struct for now.
- if (isa<PointerType>(T) || isa<ReferenceType>(T))
+ if (T->isAnyPointerType() || T->isReferenceType())
T = T->getPointeeType();
if (const RecordType *RT = T->getAsStructureType()) {
@@ -408,6 +408,8 @@ RuntimeDefinition CXXInstanceCall::getRuntimeDefinition() const {
// Is the type a C++ class? (This is mostly a defensive check.)
QualType RegionType = DynType.getType()->getPointeeType();
+ assert(!RegionType.isNull() && "DynamicTypeInfo should always be a pointer.");
+
const CXXRecordDecl *RD = RegionType->getAsCXXRecordDecl();
if (!RD || !RD->hasDefinition())
return RuntimeDefinition();
OpenPOWER on IntegriCloud