]> granicus.if.org Git - clang/commitdiff
Provide SizeOfAlignTypeExpr workaround in the static analyzer for taking the sizeof...
authorTed Kremenek <kremenek@apple.com>
Wed, 30 Apr 2008 21:31:12 +0000 (21:31 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 30 Apr 2008 21:31:12 +0000 (21:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50499 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/GRExprEngine.cpp

index 877bd09a289c629e7562bc315bfeb22bd1c6b8a7..7506c80f5e73372dc5ae27585e926027351b68ef 100644 (file)
@@ -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)