[llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp
Chris Lattner
sabre at nondot.org
Tue Apr 24 10:22:23 PDT 2007
Changes in directory llvm/lib/Bitcode/Reader:
BitcodeReader.cpp updated: 1.10 -> 1.11
---
Log message:
fix memory leak
---
Diffs of the changes: (+4 -3)
BitcodeReader.cpp | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.10 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.11
--- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.10 Tue Apr 24 02:07:11 2007
+++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Tue Apr 24 12:22:05 2007
@@ -465,11 +465,12 @@
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]
More information about the llvm-commits
mailing list