fix memory leak

llvm-svn: 36397
This commit is contained in:
Chris Lattner
2007-04-24 17:22:05 +00:00
parent c86d3f691b
commit 0ee6a3a561

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]