diff options
author | Will Dietz <wdietz2@illinois.edu> | 2013-10-13 03:08:49 +0000 |
---|---|---|
committer | Will Dietz <wdietz2@illinois.edu> | 2013-10-13 03:08:49 +0000 |
commit | 833a29c296da0a6af622448569dcbe01b5cae6c7 (patch) | |
tree | a43ff1b9af327c6276d7f17e0fd21ac345ef1fef | |
parent | 6dd7893e8c7234d65cdc47e3f3ce251fdfb35768 (diff) |
TargetLowering: Don't index into empty string.
(This is triggered by current lit tests)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192549 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/TargetLowering.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 05b025c1482..17631c0c9d9 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -2012,7 +2012,7 @@ void TargetLowering::LowerAsmOperandForConstraint(SDValue Op, std::pair<unsigned, const TargetRegisterClass*> TargetLowering:: getRegForInlineAsmConstraint(const std::string &Constraint, MVT VT) const { - if (Constraint[0] != '{') + if (Constraint.empty() || Constraint[0] != '{') return std::make_pair(0u, static_cast<TargetRegisterClass*>(0)); assert(*(Constraint.end()-1) == '}' && "Not a brace enclosed constraint?"); |