There is a potential use-after-free bug in Scop::buildSchedule(Region *,
LoopStackTy &, LoopInfo &). Before, we took a reference to LoopStack.back()
which is a use after free, since back is popped off further below. This didn't
crash before by pure chance, since LoopStack is actually a vector, and the
memory isn't freed upon pop. I turned this into an iterator-based algorithm.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
LGMT, thanks.
lib/Analysis/ScopInfo.cpp | ||
---|---|---|
4843 ↗ | (On Diff #122721) | Could you consider adding an assertion LoopData != LoopStack.rend() as well? |
4861 ↗ | (On Diff #122721) | [Nit] LoopStack.size() returns size_t, no "almost-always-auto" as of LLVM coding standards. |
4880 ↗ | (On Diff #122721) | Could you consider adding a comment on why the stack has to be popped only at the end? |