handle the case that the array element is of structure type when bind the whole array to a single value (for example, UnknownVal, UndefinedVal).
llvm-svn: 59521
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp
index fab2e60..6eba8bb 100644
--- a/clang/lib/Analysis/RegionStore.cpp
+++ b/clang/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);
}
}