diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-08-05 05:31:02 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-08-05 05:31:02 +0000 |
commit | 68c1f010d28431800451cb5bc21433f7f412f237 (patch) | |
tree | 5caba0c3bed108b205b5f837c2700dd1fe6e30aa /clang/lib/Analysis/RegionStore.cpp | |
parent | c58e5699be58c3e68c7bdf312c381789becd6df2 (diff) | |
download | bcm5719-llvm-68c1f010d28431800451cb5bc21433f7f412f237.tar.gz bcm5719-llvm-68c1f010d28431800451cb5bc21433f7f412f237.zip |
Fix a bug in RegionStoreSubRegionManager::add() where multiple subregions wouldn't correctly get registered in the SubRegion map.
llvm-svn: 78162
Diffstat (limited to 'clang/lib/Analysis/RegionStore.cpp')
-rw-r--r-- | clang/lib/Analysis/RegionStore.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp index c47aaa20e07..70201759e10 100644 --- a/clang/lib/Analysis/RegionStore.cpp +++ b/clang/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() {} |