From: Zhongxing Xu Date: Thu, 13 Nov 2008 08:41:36 +0000 (+0000) Subject: Incomplete struct pointer can be used as a function argument. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a4f28ffac7ddfe97a38f089678acec39865d0117;p=clang Incomplete struct pointer can be used as a function argument. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59235 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp index ba73761ad9..562d584558 100644 --- a/lib/Analysis/RegionStore.cpp +++ b/lib/Analysis/RegionStore.cpp @@ -301,7 +301,13 @@ Store RegionStoreManager::BindStruct(Store store, const TypedRegion* R, SVal V){ const RecordType* RT = cast(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);