mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
Clear the SCEVExpander's insertion point after making deletions,
so that the SCEVExpander doesn't retain a dangling pointer as its insert position. The dangling pointer in this case wasn't ever used to insert new instructions, but it was causing trouble with SCEVExpander's code for automatically advancing its insert position past debug intrinsics. This fixes use-after-free errors that valgrind noticed in test/Transforms/IndVarSimplify/2007-06-06-DeleteDanglesPtr.ll and test/Transforms/IndVarSimplify/exit_value_tests.ll. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99036 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -307,6 +307,10 @@ void IndVarSimplify::RewriteLoopExitValues(Loop *L,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The insertion point instruction may have been deleted; clear it out
|
||||
// so that the rewriter doesn't trip over it later.
|
||||
Rewriter.clearInsertPoint();
|
||||
}
|
||||
|
||||
void IndVarSimplify::RewriteNonIntegerIVs(Loop *L) {
|
||||
|
||||
Reference in New Issue
Block a user