Fix assertion in jump threading (PR13405).
authorRichard Osborne <richard@xmos.com>
Fri, 20 Jul 2012 10:36:17 +0000 (10:36 +0000)
committerRichard Osborne <richard@xmos.com>
Fri, 20 Jul 2012 10:36:17 +0000 (10:36 +0000)
commitdd2fb6c10b30e70ab8f910e21e583be3e90bb88c
tree1e7e77fc74349ad773b03517f4db64b33831cb53
parentf7b08226eb44458f6f38cbeaca527028803c725a
Fix assertion in jump threading (PR13405).

GetBestDestForJumpOnUndef() assumes there is at least 1 successor, which isn't
true if the block ends in an indirect branch with no successors. Fix this by
bailing out earlier in this case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160546 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/JumpThreading.cpp
test/Transforms/JumpThreading/2012-07-19-NoSuccessorIndirectBr.ll [new file with mode: 0644]