From f342d1887c9b2ef24d029c0546d536e2277b9976 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Wed, 30 Apr 2008 21:31:12 +0000 Subject: [PATCH] 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 --- lib/Analysis/GRExprEngine.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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) -- 2.40.0