aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-30 21:31:12 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-30 21:31:12 +0000
commitf342d1887c9b2ef24d029c0546d536e2277b9976 (patch)
tree1b1d0500864dc46bd9eaef0d5dc2b210425111c9 /lib/Analysis/GRExprEngine.cpp
parente8c2bde0d335a7512f453e872f064f023d48c16f (diff)
Provide SizeOfAlignTypeExpr workaround in the static analyzer for taking the sizeof of a ObjCInterfaceType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50499 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r--lib/Analysis/GRExprEngine.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index 877bd09a28..7506c80f5e 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -1432,6 +1432,12 @@ void GRExprEngine::VisitSizeOfAlignOfTypeExpr(SizeOfAlignOfTypeExpr* Ex,
if (!T.getTypePtr()->isConstantSizeType())
return;
+ // Some code tries to take the sizeof an ObjCInterfaceType, relying that
+ // the compiler has laid out its representation. Just report Unknown
+ // for these.
+ if (T->isObjCInterfaceType())
+ return;
+
amt = 1; // Handle sizeof(void)
if (T != getContext().VoidTy)