From e4f6ee590b65d7d164d11c4f185ac7e0f9fab648 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Wed, 25 Jun 2008 01:05:05 +0000 Subject: [PATCH] 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 --- lib/VMCore/Constants.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }