fix memory leak

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36397 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2007-04-24 17:22:05 +00:00
parent 4ab2d2009e
commit 084a844d6d

View File

@ -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]