1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

Make sure to update the CFG correctly if a switch only has a default dest.

This fixes CodeGen/Generic/2006-06-12-LowerSwitchCrash.ll

llvm-svn: 28755
This commit is contained in:
Chris Lattner 2006-06-12 18:25:29 +00:00
parent 317d8c2ae3
commit 2d4ba3f9ca

View File

@ -869,6 +869,7 @@ void SelectionDAGLowering::visitSwitch(SwitchInst &I) {
if (DefaultMBB != NextBlock)
DAG.setRoot(DAG.getNode(ISD::BR, MVT::Other, getRoot(),
DAG.getBasicBlock(DefaultMBB)));
CurMBB->addSuccessor(DefaultMBB);
return;
}