forked from OSchip/llvm-project
[SemaOverload] Use castAs<> instead of getAs<> to avoid dereference of nullptr
The pointer is always dereferenced inside BuildSimilarlyQualifiedPointerType, so assert the cast is correct instead of returning nullptr
This commit is contained in:
parent
18b2385f2b
commit
c61299e2b3
|
@ -2405,9 +2405,8 @@ bool Sema::IsPointerConversion(Expr *From, QualType FromType, QualType ToType,
|
|||
if (FromType->isObjCObjectPointerType() && ToPointeeType->isVoidType() &&
|
||||
!getLangOpts().ObjCAutoRefCount) {
|
||||
ConvertedType = BuildSimilarlyQualifiedPointerType(
|
||||
FromType->getAs<ObjCObjectPointerType>(),
|
||||
ToPointeeType,
|
||||
ToType, Context);
|
||||
FromType->castAs<ObjCObjectPointerType>(), ToPointeeType, ToType,
|
||||
Context);
|
||||
return true;
|
||||
}
|
||||
const PointerType *FromTypePtr = FromType->getAs<PointerType>();
|
||||
|
|
Loading…
Reference in New Issue