aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/RegionStore.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-08-05 05:31:02 +0000
committerTed Kremenek <kremenek@apple.com>2009-08-05 05:31:02 +0000
commit4ed459851eef142f2059af7ae487484e8a14fc67 (patch)
tree74a8d66a13f740e248e38bdfca8f368c2bbce557 /lib/Analysis/RegionStore.cpp
parentf35271b8677a5f31498b89587b1da42a06dd46fd (diff)
Fix a bug in RegionStoreSubRegionManager::add() where multiple subregions wouldn't correctly get registered in the SubRegion map.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78162 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RegionStore.cpp')
-rw-r--r--lib/Analysis/RegionStore.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp
index c47aaa20e0..70201759e1 100644
--- a/lib/Analysis/RegionStore.cpp
+++ b/lib/Analysis/RegionStore.cpp
@@ -121,8 +121,10 @@ class VISIBILITY_HIDDEN RegionStoreSubRegionMap : public SubRegionMap {
public:
void add(const MemRegion* Parent, const MemRegion* SubRegion) {
Map::iterator I = M.find(Parent);
- M.insert(std::make_pair(Parent,
- F.Add(I == M.end() ? F.GetEmptySet() : I->second, SubRegion)));
+ if (I == M.end())
+ M.insert(std::make_pair(Parent, F.Add(F.GetEmptySet(), SubRegion)));
+ else
+ I->second = F.Add(I->second, SubRegion);
}
~RegionStoreSubRegionMap() {}