aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2013-04-10 06:26:26 +0000
committerTed Kremenek <kremenek@apple.com>2013-04-10 06:26:26 +0000
commit02be968a08184acd42aaefa6f9a7dc883a4d1937 (patch)
tree10734a8b0fda147173a039835744bfdb83ff5863 /lib
parent0b0ca4724d1c05dc0dd1d6e5aff4c8a439cbb1a2 (diff)
Handle "typeof" in Objective-C format string checking. This previously crashed.
Yes, this came from actual code. Fixes <rdar://problem/13557053>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179155 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaChecking.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index 4e11b3aa79..8adfbd598f 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -2744,6 +2744,10 @@ CheckPrintfHandler::checkFormatExpr(const analyze_printf::PrintfSpecifier &FS,
return true;
QualType ExprTy = E->getType();
+ while (const TypeOfExprType *TET = dyn_cast<TypeOfExprType>(ExprTy)) {
+ ExprTy = TET->getUnderlyingExpr()->getType();
+ }
+
if (AT.matchesType(S.Context, ExprTy))
return true;