1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

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:
Owen Anderson 2008-06-25 01:05:05 +00:00
parent c940b5b51e
commit 968d4e2444

View File

@ -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;
}