commit | 3b3dd8847fc759ea68aa756721689248cda98cc7 | [log] [tgz] |
---|---|---|
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | Wed Aug 17 01:54:41 2016 +0000 |
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | Wed Aug 17 01:54:41 2016 +0000 |
tree | 9478586fd5dc070cec538282b7eae6da1cef56ad | |
parent | c49441293bdd5398aff3e01b653078af56c40ed2 [diff] |
Scalar: Avoid dereferencing end() in IndVarSimplify IndVarSimplify::sinkUnusedInvariants calls BasicBlock::getFirstInsertionPt on the ExitBlock and moves instructions before it. This can return end(), so it's not safe to dereference. Add an iterator-based overload to Instruction::moveBefore to avoid the UB. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278886 91177308-0d34-0410-b5e6-96231b3b80d8