summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-08-01 09:51:42 +0000
committerChris Lattner <sabre@nondot.org>2004-08-01 09:51:42 +0000
commit356f5a13f5fcd7173a39f2332aecb61c9a92c517 (patch)
treee47aa2f2e77be69cbf9ff61d905b6f3e00e2abdf /llvm/lib/CodeGen/BranchFolding.cpp
parent1cabced74b73cf5995f4909ca67e7633c8c707e4 (diff)
downloadbcm5719-llvm-356f5a13f5fcd7173a39f2332aecb61c9a92c517.tar.gz
bcm5719-llvm-356f5a13f5fcd7173a39f2332aecb61c9a92c517.zip
Dereferencing end() is bad.
llvm-svn: 15402
Diffstat (limited to 'llvm/lib/CodeGen/BranchFolding.cpp')
-rw-r--r--llvm/lib/CodeGen/BranchFolding.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index 0a6bd39ee6a..af2b7250173 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/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());
OpenPOWER on IntegriCloud