diff options
author | Owen Anderson <resistor@mac.com> | 2008-06-25 01:05:05 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-06-25 01:05:05 +0000 |
commit | e4f6ee590b65d7d164d11c4f185ac7e0f9fab648 (patch) | |
tree | 36bd365ed0ff7d68665f12f255023b1dcf92dbd1 /lib/VMCore/Constants.cpp | |
parent | d41720a2d79d2b8b587ebd3d97588aced40e2d9f (diff) | |
download | external_llvm-e4f6ee590b65d7d164d11c4f185ac7e0f9fab648.zip external_llvm-e4f6ee590b65d7d164d11c4f185ac7e0f9fab648.tar.gz external_llvm-e4f6ee590b65d7d164d11c4f185ac7e0f9fab648.tar.bz2 |
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
Diffstat (limited to 'lib/VMCore/Constants.cpp')
-rw-r--r-- | lib/VMCore/Constants.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 39c0a8c..b9976a7 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<ConstantInt>(getOperand(i))->getZExtValue(); + Result.push_back((char)cast<ConstantInt>(getOperand(i))->getZExtValue()); return Result; } |