diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index d404d15ff7b..3c633266bf9 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1390,7 +1390,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { case Intrinsic::dbg_declare: { MachineDebugInfo *DebugInfo = DAG.getMachineDebugInfo(); DbgDeclareInst &DI = cast(I); - if (DebugInfo && DebugInfo->Verify(DI.getVariable())) { + if (DebugInfo && DI.getVariable() && DebugInfo->Verify(DI.getVariable())) { std::vector Ops; SDOperand AddressOp = getValue(DI.getAddress());