Fix PR1431
authorDevang Patel <dpatel@apple.com>
Thu, 17 May 2007 22:10:15 +0000 (22:10 +0000)
committerDevang Patel <dpatel@apple.com>
Thu, 17 May 2007 22:10:15 +0000 (22:10 +0000)
Test case at Transformations/SCCP/2007-05-16-InvokeCrash.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37185 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/SCCP.cpp

index 30f4681c11458eb70af633a5a3beaeb7e035ff94..0e4fe8f52afd49820c73feaf733670441f1cb2af 100644 (file)
@@ -1417,7 +1417,7 @@ bool SCCP::runOnFunction(Function &F) {
         Instruction *Inst = BI++;
         if (Inst->getType() != Type::VoidTy) {
           LatticeVal &IV = Values[Inst];
-          if (IV.isConstant() || IV.isUndefined() &&
+          if ((IV.isConstant() || IV.isUndefined()) &&
               !isa<TerminatorInst>(Inst)) {
             Constant *Const = IV.isConstant()
               ? IV.getConstant() : UndefValue::get(Inst->getType());