VMCore/BasicBlock.cpp: Don't assume BasicBlock::iterator might end with a non-PHInode...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Tue, 9 Aug 2011 23:13:05 +0000 (23:13 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Tue, 9 Aug 2011 23:13:05 +0000 (23:13 +0000)
commit77c714027ce4188be0af75b05cbbd493221fc22f
tree92d6aa5466c5f82ffbc35e43a5f9aedb6b7d5654
parent8fc9b3db536f1523263e8b380899fb4d7df23ce1
VMCore/BasicBlock.cpp: Don't assume BasicBlock::iterator might end with a non-PHInode Instruction in successors.

Frontends(eg. clang) might pass incomplete form of IR, to step off the way beyond iterator end. In the case I had met, it took infinite loop due to meeting bogus PHInode.

Thanks to Jay Foad and John McCall.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137175 91177308-0d34-0410-b5e6-96231b3b80d8
lib/VMCore/BasicBlock.cpp