Fix findCaseDest to return null when BB is both the default dest and one

of the numeric cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30468 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky 2006-09-18 20:44:37 +00:00
parent 2ab804c607
commit d791544c9f

View File

@ -1313,6 +1313,8 @@ public:
/// findCaseDest - Finds the unique case value for a given successor. Returns
/// null if the successor is not found, not unique, or is the default case.
ConstantInt *findCaseDest(BasicBlock *BB) {
if (BB == getDefaultDest()) return NULL;
ConstantInt *CI = NULL;
for (unsigned i = 1, e = getNumCases(); i != e; ++i) {
if (getSuccessor(i) == BB) {