projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c62dfe5
)
[X86] Fix sanitizer bot failure from 344085
author
Rong Xu
<xur@google.com>
Tue, 9 Oct 2018 23:10:56 +0000
(23:10 +0000)
committer
Rong Xu
<xur@google.com>
Tue, 9 Oct 2018 23:10:56 +0000
(23:10 +0000)
Fix the memory issue exposed by sanitizer.
llvm-svn: 344092
llvm/lib/Target/X86/X86CondBrFolding.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Target/X86/X86CondBrFolding.cpp
b/llvm/lib/Target/X86/X86CondBrFolding.cpp
index
9a5ae70
..
8b9ef20
100644
(file)
--- a/
llvm/lib/Target/X86/X86CondBrFolding.cpp
+++ b/
llvm/lib/Target/X86/X86CondBrFolding.cpp
@@
-424,8
+424,9
@@
bool X86CondBrFolding::optimize() {
}
NumFixedCondBrs += RemoveList.size();
for (auto MBBI : RemoveList) {
- for (auto *Succ : MBBI->successors())
- MBBI->removeSuccessor(Succ);
+ while (!MBBI->succ_empty())
+ MBBI->removeSuccessor(MBBI->succ_end() - 1);
+
MBBI->eraseFromParent();
}