Fix bad length argument to substr calls. Apparently I'm the first one to

attempt more than 2 constraints on an instruction.

llvm-svn: 80169
This commit is contained in:
Bob Wilson 2009-08-26 22:50:39 +00:00
parent 4d7b2e3307
commit 904d4c71d5
1 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ static void ParseConstraint(const std::string &CStr, CodeGenInstruction *I) {
std::string::size_type pos = CStr.find_first_of('=');
assert(pos != std::string::npos && "Unrecognized constraint");
std::string::size_type start = CStr.find_first_not_of(" \t");
std::string Name = CStr.substr(start, pos);
std::string Name = CStr.substr(start, pos - start);
// TIED_TO: $src1 = $dst
std::string::size_type wpos = Name.find_first_of(" \t");
@ -70,7 +70,7 @@ static void ParseConstraints(const std::string &CStr, CodeGenInstruction *I) {
if (eidx == std::string::npos)
eidx = CStr.length();
ParseConstraint(CStr.substr(bidx, eidx), I);
ParseConstraint(CStr.substr(bidx, eidx - bidx), I);
bidx = CStr.find_first_not_of(delims, eidx);
}
}