aboutsummaryrefslogtreecommitdiff
path: root/clang/lib
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-08-07 05:12:24 +0000
committerAnna Zaks <ganna@apple.com>2012-08-07 05:12:24 +0000
commit75930b65b48a02740b49b310c0a0adcf89724046 (patch)
tree3ce69b058b94593f25f23a8fedc5bbd404b43c24 /clang/lib
parent96b5f0780814908b84363205a357a9e90d2843fd (diff)
downloadllvm-75930b65b48a02740b49b310c0a0adcf89724046.zip
llvm-75930b65b48a02740b49b310c0a0adcf89724046.tar.gz
llvm-75930b65b48a02740b49b310c0a0adcf89724046.tar.bz2
[analyzer] Address Jordan's review of DynamicTypePropagation.
llvm-svn: 161391
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp3
-rw-r--r--clang/lib/StaticAnalyzer/Core/CallEvent.cpp4
2 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp b/clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp
index fec6c43..d9edab8 100644
--- a/clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp
@@ -75,7 +75,8 @@ void DynamicTypePropagation::checkPostCall(const CallEvent &Call,
// Assume, the result of the init method has the same dynamic type as
// the receiver and propagate the dynamic type info.
const MemRegion *RecReg = Msg->getReceiverSVal().getAsRegion();
- assert(RecReg);
+ if (!RecReg)
+ return;
DynamicTypeInfo RecDynType = State->getDynamicTypeInfo(RecReg);
C.addTransition(State->addDynamicTypeInfo(RetReg, RecDynType));
break;
diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
index 396e0f6..006ca10 100644
--- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
+++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
@@ -670,14 +670,14 @@ const Decl *ObjCMethodCall::getRuntimeDefinition() const {
const ObjCObjectPointerType *ReceiverT = 0;
QualType SupersType = E->getSuperType();
if (!SupersType.isNull()) {
- ReceiverT = cast<ObjCObjectPointerType>(SupersType.getTypePtr());
+ ReceiverT = cast<ObjCObjectPointerType>(SupersType);
} else {
const MemRegion *Receiver = getReceiverSVal().getAsRegion();
if (!Receiver)
return 0;
QualType DynType = getState()->getDynamicTypeInfo(Receiver).getType();
- ReceiverT = dyn_cast<ObjCObjectPointerType>(DynType.getTypePtr());
+ ReceiverT = dyn_cast<ObjCObjectPointerType>(DynType);
}
// Lookup the method implementation.