diff options
author | Chris Lattner <sabre@nondot.org> | 2004-08-01 09:51:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-08-01 09:51:42 +0000 |
commit | 4ae131e5da124bb5f7455133fefb1fa3b336192b (patch) | |
tree | c0583af45ea03597d977d089e1d4a2522aa6feb7 /lib | |
parent | 33c23ddf8a170f9576e4b6de840e8ad1e5fcdfd3 (diff) | |
download | external_llvm-4ae131e5da124bb5f7455133fefb1fa3b336192b.zip external_llvm-4ae131e5da124bb5f7455133fefb1fa3b336192b.tar.gz external_llvm-4ae131e5da124bb5f7455133fefb1fa3b336192b.tar.bz2 |
Dereferencing end() is bad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15402 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/BranchFolding.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp index 0a6bd39..af2b725 100644 --- a/lib/CodeGen/BranchFolding.cpp +++ b/lib/CodeGen/BranchFolding.cpp @@ -96,7 +96,7 @@ static void ReplaceUsesOfBlockWith(MachineBasicBlock *BB, // If BB falls through into Old, insert an unconditional branch to New. MachineFunction::iterator BBSucc = BB; ++BBSucc; - if (&*BBSucc == Old) + if (BBSucc != BB->getParent()->end() && &*BBSucc == Old) TII.insertGoto(*BB, *New); std::vector<MachineBasicBlock*> Succs(BB->succ_begin(), BB->succ_end()); |