RegionInfo: Do not access a value that was just moved away

This fixes a regression introduced in r206310.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206328 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Tobias Grosser 2014-04-15 22:09:36 +00:00
parent d24010f61a
commit d4955a007b

View File

@ -363,8 +363,8 @@ void Region::addSubRegion(Region *SubRegion, bool moveChildren) {
std::vector<std::unique_ptr<Region>> Keep;
for (iterator I = begin(), E = end(); I != E; ++I)
if (SubRegion->contains(I->get()) && I->get() != SubRegion) {
SubRegion->children.push_back(std::move(*I));
(*I)->parent = SubRegion;
SubRegion->children.push_back(std::move(*I));
} else
Keep.push_back(std::move(*I));