diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-01-25 00:04:09 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-01-25 00:04:09 +0000 |
commit | e6ca97f2aeb301e28d20988b27c4297a9b540991 (patch) | |
tree | 021171b1ad32f2a4fbba08c84be2234f6749c767 /lib/Analysis | |
parent | d814eaf0dfb30f1cb6f90b056f8126f7e31e7ef4 (diff) |
Fix NSLog format string checking for %@.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148885 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/FormatString.cpp | 3 | ||||
-rw-r--r-- | lib/Analysis/PrintfFormatString.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/Analysis/FormatString.cpp b/lib/Analysis/FormatString.cpp index a4d97fd90a..a0633c80d3 100644 --- a/lib/Analysis/FormatString.cpp +++ b/lib/Analysis/FormatString.cpp @@ -337,7 +337,8 @@ bool ArgTypeResult::matchesType(ASTContext &C, QualType argTy) const { argTy->isNullPtrType(); case ObjCPointerTy: - return argTy->getAs<ObjCObjectPointerType>() != NULL; + return argTy->getAs<ObjCObjectPointerType>() || + argTy->getAs<BlockPointerType>(); } llvm_unreachable("Invalid ArgTypeResult Kind!"); diff --git a/lib/Analysis/PrintfFormatString.cpp b/lib/Analysis/PrintfFormatString.cpp index dbe73c8f83..e5566f1411 100644 --- a/lib/Analysis/PrintfFormatString.cpp +++ b/lib/Analysis/PrintfFormatString.cpp @@ -319,6 +319,8 @@ ArgTypeResult PrintfSpecifier::getArgType(ASTContext &Ctx) const { return ArgTypeResult(Ctx.WCharTy, "wchar_t"); case ConversionSpecifier::pArg: return ArgTypeResult::CPointerTy; + case ConversionSpecifier::ObjCObjArg: + return ArgTypeResult::ObjCPointerTy; default: break; } |