[JITLink][RISCV] Fix use-after-free in relax
Finalization of relaxation calls `finalizeBlockRelax` for every block in the graph. This function, however, would iterate over //all// blocks in the graph to remove `AlignRelaxable` edges. Since pointers to those edges would still be stored in `RelaxEdges`, this caused a use-after-free for graphs with multiple blocks. This patch fixes this by only iterating over the edges of the current block in `finalizeBlockRelax`. Reviewed By: StephenFan Differential Revision: https://reviews.llvm.org/D154844
Loading
Please sign in to comment