aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-04-24 17:22:05 +0000
committerChris Lattner <sabre@nondot.org>2007-04-24 17:22:05 +0000
commit084a844d6d3c4176a8137c7cf980c2b6c7731e34 (patch)
treefce102e9ef7a07ace0a40a9845e542212b1bb883 /lib
parent4ab2d2009e4a16d1a5104047e1e2cdbbf2cb9b1a (diff)
downloadexternal_llvm-084a844d6d3c4176a8137c7cf980c2b6c7731e34.zip
external_llvm-084a844d6d3c4176a8137c7cf980c2b6c7731e34.tar.gz
external_llvm-084a844d6d3c4176a8137c7cf980c2b6c7731e34.tar.bz2
fix memory leak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36397 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index 99df1f9..87f0369 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -465,11 +465,12 @@ bool BitcodeReader::ParseConstants(BitstreamReader &Stream) {
return Error("Invalid WIDE_INTEGER record");
unsigned NumWords = Record[0];
- uint64_t *Data = new uint64_t[NumWords];
+ SmallVector<uint64_t, 8> Words;
+ Words.resize(NumWords);
for (unsigned i = 0; i != NumWords; ++i)
- Data[i] = DecodeSignRotatedValue(Record[i+1]);
+ Words[i] = DecodeSignRotatedValue(Record[i+1]);
V = ConstantInt::get(APInt(cast<IntegerType>(CurTy)->getBitWidth(),
- NumWords, Data));
+ NumWords, &Words[0]));
break;
}
case bitc::CST_CODE_FLOAT: // FLOAT: [fpval]