From: Owen Anderson Date: Wed, 25 Jun 2008 01:05:05 +0000 (+0000) Subject: Use push_back rather than operator[], which is incorrect in this cases. Unfortunately... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e4f6ee590b65d7d164d11c4f185ac7e0f9fab648;p=oota-llvm.git Use push_back rather than operator[], which is incorrect in this cases. Unfortunately, this slow the testcase down a little bit, but only marginally. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52700 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 39c0a8c7010..b9976a72070 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -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(getOperand(i))->getZExtValue(); + Result.push_back((char)cast(getOperand(i))->getZExtValue()); return Result; }