Ensure OpCode is not used uninitialized.
authorDuncan Sands <baldrick@free.fr>
Wed, 5 Oct 2011 15:13:13 +0000 (15:13 +0000)
committerDuncan Sands <baldrick@free.fr>
Wed, 5 Oct 2011 15:13:13 +0000 (15:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141184 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PTX/PTXISelDAGToDAG.cpp

index af47208c95911d60fe0809a4a703850b7c84200a..5c7ee298f31abd1e420f4370d2127f0d890b8e70 100644 (file)
@@ -125,8 +125,10 @@ SDNode *PTXDAGToDAGISel::SelectREADPARAM(SDNode *Node) {
     OpCode = PTX::READPARAMI64;
   else if (Type == MVT::f32)
     OpCode = PTX::READPARAMF32;
-  else if (Type == MVT::f64)
+  else {
+    assert(Type == MVT::f64 && "Unexpected type!");
     OpCode = PTX::READPARAMF64;
+  }
 
   SDValue Pred = CurDAG->getRegister(PTX::NoRegister, MVT::i1);
   SDValue PredOp = CurDAG->getTargetConstant(PTXPredicate::None, MVT::i32);