diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-04-30 21:31:12 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-04-30 21:31:12 +0000 |
commit | 99057462aa001be4327078b5c80e5d3a67a01b3c (patch) | |
tree | 5e137bb0404b814684ed2a78dfcc12188118924e /clang/lib/Analysis/GRExprEngine.cpp | |
parent | e0e8b535cf31e7f783842711e531b32257bee94f (diff) | |
download | bcm5719-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.cpp | 6 |
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) |