[llvm] r305785 - [SelectionDAG] Fix an use-after-free issue introduced in r305775.
Haojian Wu via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 20 02:29:44 PDT 2017
Author: hokein
Date: Tue Jun 20 04:29:43 2017
New Revision: 305785
URL: http://llvm.org/viewvc/llvm-project?rev=305785&view=rev
Log:
[SelectionDAG] Fix an use-after-free issue introduced in r305775.
vector.back() will be invalidated when memory reallocation happens.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=305785&r1=305784&r2=305785&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Tue Jun 20 04:29:43 2017
@@ -1888,10 +1888,10 @@ CalcNodeSethiUllmanNumber(const SUnit *S
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;
}
}
More information about the llvm-commits
mailing list