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
- Build Status
Buildable 12132 Build 12132: arc lint + arc unit
Event Timeline
Comment Actions
LGMT, thanks.
lib/Analysis/ScopInfo.cpp | ||
---|---|---|
4843 | Could you consider adding an assertion LoopData != LoopStack.rend() as well? | |
4861 | [Nit] LoopStack.size() returns size_t, no "almost-always-auto" as of LLVM coding standards. | |
4880 | Could you consider adding a comment on why the stack has to be popped only at the end? |
Could you consider adding an assertion LoopData != LoopStack.rend() as well?