OSDN Git Service

CodeGen: Don't dereference end() in MachineBasicBlock::CorrectExtraCFGEdges
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 16 Aug 2016 21:46:03 +0000 (21:46 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 16 Aug 2016 21:46:03 +0000 (21:46 +0000)
commit52a07ee47a6decb521591386420d0de317cdf78c
tree7df83ad0ee9f2ffb740683ad9ad7bafa8a4dca96
parentb3c0427a43985acb6f36a90de4fbc4446261392a
CodeGen: Don't dereference end() in MachineBasicBlock::CorrectExtraCFGEdges

The current MachineBasicBlock might be the last block, so FallThru may
be past the end().  Use getNextNode(), which will convert to nullptr,
rather than &*++, which is invalid if we reach the end().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278858 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineBasicBlock.cpp