mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-01 00:25:01 +00:00
Fix reference to cached end iterator invalidated by an erase operation.
Uncovered by _GLIBCXX_DEBUG. llvm-svn: 37795
This commit is contained in:
parent
244fb44f6b
commit
df6a87ea1c
@ -1700,7 +1700,9 @@ unsigned SelectionDAGLowering::Clusterify(CaseVector& Cases,
|
||||
|
||||
// Merge case into clusters
|
||||
if (Cases.size()>=2)
|
||||
for (CaseItr I=Cases.begin(), J=++(Cases.begin()), E=Cases.end(); J!=E; ) {
|
||||
// Cray [dag]: Must recompute end() each iteration because it may
|
||||
// be invalidated by erase if we hold on to it
|
||||
for (CaseItr I=Cases.begin(), J=++(Cases.begin()); J!=Cases.end(); ) {
|
||||
int64_t nextValue = cast<ConstantInt>(J->Low)->getSExtValue();
|
||||
int64_t currentValue = cast<ConstantInt>(I->High)->getSExtValue();
|
||||
MachineBasicBlock* nextBB = J->BB;
|
||||
|
Loading…
Reference in New Issue
Block a user