summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorWill Dietz <wdietz2@illinois.edu>2013-10-13 03:08:49 +0000
committerWill Dietz <wdietz2@illinois.edu>2013-10-13 03:08:49 +0000
commitae726a93e31e2c16ce78cba296469d0c288f21d5 (patch)
treec0d0de1a7244e842d72ea7b931f55b8bd7d83061 /llvm/lib/CodeGen
parent9f21325ac732ab6f0b57dbad7f2099b0679156cf (diff)
downloadbcm5719-llvm-ae726a93e31e2c16ce78cba296469d0c288f21d5.tar.gz
bcm5719-llvm-ae726a93e31e2c16ce78cba296469d0c288f21d5.zip
TargetLowering: Don't index into empty string.
(This is triggered by current lit tests) llvm-svn: 192549
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp2
1 files changed, 1 insertions, 1 deletions
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<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?");
OpenPOWER on IntegriCloud