forked from OSchip/llvm-project
Use push_back rather than operator[], which is incorrect in this cases. Unfortunately, this slow the testcase down a little bit,
but only marginally. llvm-svn: 52700
This commit is contained in:
parent
845eb8ea44
commit
ee9c30d435
|
@ -1380,7 +1380,7 @@ std::string ConstantArray::getAsString() const {
|
|||
std::string Result;
|
||||
Result.reserve(getNumOperands());
|
||||
for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
|
||||
Result[i] = (char)cast<ConstantInt>(getOperand(i))->getZExtValue();
|
||||
Result.push_back((char)cast<ConstantInt>(getOperand(i))->getZExtValue());
|
||||
return Result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue