]> granicus.if.org Git - llvm/commit
SDAG: Update ChainNodesMatched during UpdateChains if a node is replaced
authorJustin Bogner <mail@justinbogner.com>
Mon, 30 Jan 2017 18:29:46 +0000 (18:29 +0000)
committerJustin Bogner <mail@justinbogner.com>
Mon, 30 Jan 2017 18:29:46 +0000 (18:29 +0000)
commit247041ef058cbfe0125943d0d1043ed5f95fefd5
tree79d353ce36f8aa90ad6dd607f6066952c10fe97e
parent64b37c58252942eb25d86d289bb561ebc196fb0b
SDAG: Update ChainNodesMatched during UpdateChains if a node is replaced

Previously, we would hit UB (or the ISD::DELETED_NODE assert) if we
happened to replace a node during UpdateChains, because it would be
left in the list we were iterating over. This nulls out the pointer
when that happens so that we can avoid the issue.

Fixes llvm.org/PR31710

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293522 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/SelectionDAGISel.h
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
test/CodeGen/SystemZ/pr31710.ll [new file with mode: 0644]