]> granicus.if.org Git - llvm/commit
[Local] Handle terminators with users in removeUnreachableBlocks.
authorFlorian Hahn <flo@fhahn.com>
Wed, 2 Oct 2019 19:38:24 +0000 (19:38 +0000)
committerFlorian Hahn <flo@fhahn.com>
Wed, 2 Oct 2019 19:38:24 +0000 (19:38 +0000)
commit2351e6ea75c36004c8c0822881bfc683333b1a63
treeb837147d416b3eb860c465f3525d39aac99d80bc
parentc1679d6c229dca9bf7b6a7e98256ee39967339df
[Local] Handle terminators with users in removeUnreachableBlocks.

Terminators like invoke can have users outside the current basic block.
We have to replace those users with undef, before replacing the
terminator.

This fixes a crash exposed by rL373430.

Reviewers: brzycki, asbirlea, davide, spatel

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D68327

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373513 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/Local.cpp
unittests/Transforms/Utils/LocalTest.cpp