[cfe-commits] r59235 - /cfe/trunk/lib/Analysis/RegionStore.cpp

Zhongxing Xu xuzhongxing at gmail.com
Thu Nov 13 00:41:36 PST 2008


Author: zhongxingxu
Date: Thu Nov 13 02:41:36 2008
New Revision: 59235

URL: http://llvm.org/viewvc/llvm-project?rev=59235&view=rev
Log:
Incomplete struct pointer can be used as a function argument.

Modified:
    cfe/trunk/lib/Analysis/RegionStore.cpp

Modified: cfe/trunk/lib/Analysis/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RegionStore.cpp?rev=59235&r1=59234&r2=59235&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/RegionStore.cpp (original)
+++ cfe/trunk/lib/Analysis/RegionStore.cpp Thu Nov 13 02:41:36 2008
@@ -301,7 +301,13 @@
 
   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);
 





More information about the cfe-commits mailing list