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

This fixes a regression introduced in r206310.

llvm-svn: 206328
This commit is contained in:
Tobias Grosser 2014-04-15 22:09:36 +00:00
parent b35cc69680
commit fdada48f35

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));