Changes in directory llvm/include/llvm:

Instructions.h updated: 1.41 -> 1.42
---
Log message:

Fix findCaseDest to return null when BB is both the default dest and one
of the numeric cases.


---
Diffs of the changes:  (+2 -0)

 Instructions.h |    2 ++
 1 files changed, 2 insertions(+)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.41 
llvm/include/llvm/Instructions.h:1.42
--- llvm/include/llvm/Instructions.h:1.41       Mon Sep 18 14:03:59 2006
+++ llvm/include/llvm/Instructions.h    Mon Sep 18 15:44:37 2006
@@ -1313,6 +1313,8 @@
   /// 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) {



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to