summaryrefslogtreecommitdiffstats
path: root/clang/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
commit99057462aa001be4327078b5c80e5d3a67a01b3c (patch)
tree5e137bb0404b814684ed2a78dfcc12188118924e /clang/lib/Analysis/GRExprEngine.cpp
parente0e8b535cf31e7f783842711e531b32257bee94f (diff)
downloadbcm5719-llvm-99057462aa001be4327078b5c80e5d3a67a01b3c.tar.gz
bcm5719-llvm-99057462aa001be4327078b5c80e5d3a67a01b3c.zip
Provide SizeOfAlignTypeExpr workaround in the static analyzer for taking the sizeof of a ObjCInterfaceType.
llvm-svn: 50499
Diffstat (limited to 'clang/lib/Analysis/GRExprEngine.cpp')
-rw-r--r--clang/lib/Analysis/GRExprEngine.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp
index 877bd09a289..7506c80f5e7 100644
--- a/clang/lib/Analysis/GRExprEngine.cpp
+++ b/clang/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)
OpenPOWER on IntegriCloud