summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
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
commit0ee6a3a56155295711608e19b9f559c8ca3a461f (patch)
treebecd5399186eb8faae6daa95e1d4426f90210c9f /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parentc86d3f691b70eaf45b01f1decc52bd43667c1453 (diff)
downloadbcm5719-llvm-0ee6a3a56155295711608e19b9f559c8ca3a461f.tar.gz
bcm5719-llvm-0ee6a3a56155295711608e19b9f559c8ca3a461f.zip
fix memory leak
llvm-svn: 36397
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 99df1f95902..87f0369c2ac 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/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]
OpenPOWER on IntegriCloud