[X86] In X86DAGToDAGISel::PreprocessISelDAG, make sure we don't access N after we delete it.

If we turn X86ISD::AND into ISD::AND, we delete N. But we were continuing onto the next block of code even though N no longer existed.

Just happened to notice it. I assume asan didn't notice it because we explicitly unpoison deleted nodes and give them a DELETE_NODE opcode.

llvm-svn: 335787
This commit is contained in:
Craig Topper 2018-06-27 20:58:46 +00:00
parent 9b65ffb097
commit 880e34ed45
1 changed files with 1 additions and 0 deletions

View File

@ -668,6 +668,7 @@ void X86DAGToDAGISel::PreprocessISelDAG() {
CurDAG->ReplaceAllUsesOfValueWith(SDValue(N, 0), Res);
++I;
CurDAG->DeleteNode(N);
continue;
}
if (OptLevel != CodeGenOpt::None &&