Skip to content

Commit 438ec14

Browse files
committed
Fix memory leak in unit test of Bitcode/BitReaderTest.cpp
Fixes obvious memory leak in test TestForEofAfterReadFailureOnDataStreamer. Also removes constexpr use from same test. Patch by Karl Schimpf. Differential Revision: http://reviews.llvm.org/D11735 llvm-svn: 243904
1 parent 871b411 commit 438ec14

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/unittests/Bitcode/BitReaderTest.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,12 @@ TEST(BitReaderTest, TestForEofAfterReadFailureOnDataStreamer) {
118118
// Jump to two bytes before end of stream.
119119
Cursor.JumpToBit((InputSize - 4) * CHAR_BIT);
120120
// Try to read 4 bytes when only 2 are present, resulting in error value 0.
121-
constexpr size_t ReadErrorValue = 0;
121+
const size_t ReadErrorValue = 0;
122122
EXPECT_EQ(ReadErrorValue, Cursor.Read(32));
123123
// Should be at eof now.
124124
EXPECT_TRUE(Cursor.AtEndOfStream());
125+
126+
delete[] Text;
125127
}
126128

127129
TEST(BitReaderTest, MateralizeForwardRefWithStream) {

0 commit comments

Comments
 (0)