[ScopInfo] Avoid iterator invalidation.
authorMichael Kruse <llvm@meinersbur.de>
Tue, 10 Apr 2018 01:20:41 +0000 (01:20 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Tue, 10 Apr 2018 01:20:41 +0000 (01:20 +0000)
commitdb6f71e48db408f33a94bacb7289e14325de8ea1
tree56176a6e8a442c2efb1b2688247c99afbc91d115
parent37b1dd62bb253ac74de840781c2c68a57edffe50
[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.

llvm-svn: 329653
polly/lib/Analysis/ScopInfo.cpp
polly/test/ScopInfo/invalidate_iterator_during_MA_removal.ll [new file with mode: 0644]