InequalityGraph::node() can create new nodes, invalidating iterators across

the set of nodes. Fix makeEqual to handle this by creating the new node first
then iterating across them second.

llvm-svn: 51573
This commit is contained in:
Nick Lewycky 2008-05-27 00:59:05 +00:00
parent 6be65d2a84
commit 3ebe82b57a
1 changed files with 1 additions and 0 deletions

View File

@ -1594,6 +1594,7 @@ namespace {
if (mergeIGNode) {
// Create N1.
if (!n1) n1 = VN.getOrInsertVN(V1, Top);
IG.node(n1); // Ensure that IG.Nodes won't get resized
// Migrate relationships from removed nodes to N1.
for (SetVector<unsigned>::iterator I = Remove.begin(), E = Remove.end();