mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-03-04 16:41:43 +00:00
[NFC][CLANG] Fix Static Code Analyzer Concerns with dereference null return value in applyObjCTypeArgs()
This patch uses castAs instead of getAs to resolve dereference issue with nullptr boundObjC when calling canAssignObjCInterfaces() or isObjCIdType() in applyObjCTypeArgs() since getAs returns nullptr. Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D151964
This commit is contained in:
parent
02ce49afb9
commit
82659941cc
@ -950,7 +950,7 @@ static QualType applyObjCTypeArgs(Sema &S, SourceLocation loc, QualType type,
|
||||
|
||||
// Retrieve the bound.
|
||||
QualType bound = typeParam->getUnderlyingType();
|
||||
const auto *boundObjC = bound->getAs<ObjCObjectPointerType>();
|
||||
const auto *boundObjC = bound->castAs<ObjCObjectPointerType>();
|
||||
|
||||
// Determine whether the type argument is substitutable for the bound.
|
||||
if (typeArgObjC->isObjCIdType()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user