aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-06-12 18:25:29 +0000
committerChris Lattner <sabre@nondot.org>2006-06-12 18:25:29 +0000
commita3bb86dd6b6220c69d9d7e4e11aea42fa1ec2bc5 (patch)
tree75908840d2fabb1e8694be75f0e767eae61afed1 /lib/CodeGen
parent1398421ccf060f4894d5ff8fe913bc6a5493dc33 (diff)
downloadexternal_llvm-a3bb86dd6b6220c69d9d7e4e11aea42fa1ec2bc5.zip
external_llvm-a3bb86dd6b6220c69d9d7e4e11aea42fa1ec2bc5.tar.gz
external_llvm-a3bb86dd6b6220c69d9d7e4e11aea42fa1ec2bc5.tar.bz2
Make sure to update the CFG correctly if a switch only has a default dest.
This fixes CodeGen/Generic/2006-06-12-LowerSwitchCrash.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28755 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 0a9cb63..1c8714d 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -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;
}