]> granicus.if.org Git - clang/commitdiff
Stop tracking non-compound value for struct. It may be caused by imprecise cast
authorZhongxing Xu <xuzhongxing@gmail.com>
Sat, 13 Jun 2009 01:31:11 +0000 (01:31 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Sat, 13 Jun 2009 01:31:11 +0000 (01:31 +0000)
logic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73279 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/RegionStore.cpp

index 8ce37e60693e545fcf055fa1b143da06e18f41b2..eae3aefe218fafd92fb4cc9b96a4b279b62b52c1 100644 (file)
@@ -1198,8 +1198,10 @@ RegionStoreManager::BindStruct(const GRState* St, const TypedRegion* R, SVal V){
   if (V.isUnknown())
     return KillStruct(St, R);
 
-  if (isa<nonloc::SymbolVal>(V))
-    return setDefaultValue(St, R, V);
+  // We may get non-CompoundVal accidentally due to imprecise cast logic. Ignore
+  // them and make struct unknown.
+  if (!isa<nonloc::CompoundVal>(V))
+    return KillStruct(St, R);
 
   nonloc::CompoundVal& CV = cast<nonloc::CompoundVal>(V);
   nonloc::CompoundVal::iterator VI = CV.begin(), VE = CV.end();