]> granicus.if.org Git - clang/commitdiff
Incomplete struct pointer can be used as a function argument.
authorZhongxing Xu <xuzhongxing@gmail.com>
Thu, 13 Nov 2008 08:41:36 +0000 (08:41 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Thu, 13 Nov 2008 08:41:36 +0000 (08:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59235 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/RegionStore.cpp

index ba73761ad9fdbda311f5b1d2a4da1bc224f8b2db..562d5845588f9df22d79ebc145f2462b5cbc4f99 100644 (file)
@@ -301,7 +301,13 @@ Store RegionStoreManager::BindStruct(Store store, const TypedRegion* R, SVal V){
 
   const RecordType* RT = cast<RecordType>(T.getTypePtr());
   RecordDecl* RD = RT->getDecl();
-  assert(RD->isDefinition());
+
+  if (!RD->isDefinition()) {
+    // This can only occur when a pointer of imcomplete struct type is used as a
+    // function argument.
+    assert(V.isUnknown());
+    return store;
+  }
 
   RegionBindingsTy B = GetRegionBindings(store);