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

of the numeric cases.

llvm-svn: 30468
This commit is contained in:
Nick Lewycky 2006-09-18 20:44:37 +00:00
parent f23e3bfcb2
commit 86bda361b0
1 changed files with 2 additions and 0 deletions

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) {