summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2017-06-20 09:29:43 +0000
committerHaojian Wu <hokein@google.com>2017-06-20 09:29:43 +0000
commit6bd5cc6239849532f0c39a8115dda9ffe2f73136 (patch)
treef7e158a3c3e5ecfb5db4bb0864a5a9596b339a18 /llvm/lib/CodeGen/SelectionDAG
parent1dcd5e8dc8274ede357868577abd7ac32f9b3bd9 (diff)
downloadbcm5719-llvm-6bd5cc6239849532f0c39a8115dda9ffe2f73136.tar.gz
bcm5719-llvm-6bd5cc6239849532f0c39a8115dda9ffe2f73136.zip
[SelectionDAG] Fix an use-after-free issue introduced in r305775.
vector.back() will be invalidated when memory reallocation happens. llvm-svn: 305785
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
index c90747943f5..70b1fa77a09 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
@@ -1888,10 +1888,10 @@ CalcNodeSethiUllmanNumber(const SUnit *SU, std::vector<unsigned> &SUNumbers) {
for (auto It : WorkList)
assert(It.SU != PredSU && "Trying to push an element twice?");
#endif
- WorkList.push_back(PredSU);
- AllPredsKnown = false;
// Next time start processing this one starting from the next pred.
Temp.PredsProcessed = P + 1;
+ WorkList.push_back(PredSU);
+ AllPredsKnown = false;
break;
}
}
OpenPOWER on IntegriCloud