From ae726a93e31e2c16ce78cba296469d0c288f21d5 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Sun, 13 Oct 2013 03:08:49 +0000 Subject: TargetLowering: Don't index into empty string. (This is triggered by current lit tests) llvm-svn: 192549 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/SelectionDAG') diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 05b025c1482..17631c0c9d9 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -2012,7 +2012,7 @@ void TargetLowering::LowerAsmOperandForConstraint(SDValue Op, std::pair TargetLowering:: getRegForInlineAsmConstraint(const std::string &Constraint, MVT VT) const { - if (Constraint[0] != '{') + if (Constraint.empty() || Constraint[0] != '{') return std::make_pair(0u, static_cast(0)); assert(*(Constraint.end()-1) == '}' && "Not a brace enclosed constraint?"); -- cgit v1.2.3