handle the case that the array element is of structure type when bind the whole array to a single value (for example, UnknownVal, UndefinedVal).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59521 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp
index fab2e60..6eba8bb 100644
--- a/lib/Analysis/RegionStore.cpp
+++ b/lib/Analysis/RegionStore.cpp
@@ -569,7 +569,10 @@
ElementRegion* ER = MRMgr.getElementRegion(Idx, BaseR);
- store = Bind(store, loc::MemRegionVal(ER), V);
+ if (CAT->getElementType()->isStructureType())
+ store = BindStructToVal(store, ER, V);
+ else
+ store = Bind(store, loc::MemRegionVal(ER), V);
}
}