[ScopInfo] Avoid iterator invalidation.
commit4348da960d6eb89ffeaa11a4a38b69598d9e772d
authorMichael Kruse <llvm@meinersbur.de>
Tue, 10 Apr 2018 01:20:41 +0000 (10 01:20 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Tue, 10 Apr 2018 01:20:41 +0000 (10 01:20 +0000)
tree85d0968a211ee63f7fbfee9ef391da36ad73de3c
parent85ca8eda962a73732d6e19e24c779b661cdcd55b
[ScopInfo] Avoid iterator invalidation.

Commit r329640 introduced the removal of all MemoryAccesses of a Scop.
It accidentally continued iterating over a vector whose iterators
have been invalidated by a MemoryAccess removal.

Make a copy of the MemoryAccesses to remove to iterate over while
removing them.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@329653 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScopInfo.cpp
test/ScopInfo/invalidate_iterator_during_MA_removal.ll [new file with mode: 0644]