projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
33c23dd
)
Dereferencing end() is bad.
author
Chris Lattner
<sabre@nondot.org>
Sun, 1 Aug 2004 09:51:42 +0000
(09:51 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Sun, 1 Aug 2004 09:51:42 +0000
(09:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15402
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/CodeGen/BranchFolding.cpp
patch
|
blob
|
history
diff --git
a/lib/CodeGen/BranchFolding.cpp
b/lib/CodeGen/BranchFolding.cpp
index 0a6bd39ee6a984febf5db4128cf64a98d68718d6..af2b72501733bcd477e5576adf7ffccee3505be3 100644
(file)
--- 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());