diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp | 3 | ||||
-rw-r--r-- | lib/StaticAnalyzer/Core/CallEvent.cpp | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp b/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp index fec6c43dbd..d9edab8ede 100644 --- a/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp +++ b/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/lib/StaticAnalyzer/Core/CallEvent.cpp b/lib/StaticAnalyzer/Core/CallEvent.cpp index 396e0f6d8d..006ca1043a 100644 --- a/lib/StaticAnalyzer/Core/CallEvent.cpp +++ b/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. |