From: Derek Schuff Date: Mon, 3 Aug 2015 21:23:51 +0000 (+0000) Subject: Fix memory leak in unit test of Bitcode/BitReaderTest.cpp X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=83e36d9d45cdb1e4a9527772c71f37469d6784e0;p=oota-llvm.git 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243904 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/Bitcode/BitReaderTest.cpp b/unittests/Bitcode/BitReaderTest.cpp index d9e207e9ba3..055850da505 100644 --- a/unittests/Bitcode/BitReaderTest.cpp +++ b/unittests/Bitcode/BitReaderTest.cpp @@ -118,10 +118,12 @@ TEST(BitReaderTest, TestForEofAfterReadFailureOnDataStreamer) { // Jump to two bytes before end of stream. Cursor.JumpToBit((InputSize - 4) * CHAR_BIT); // Try to read 4 bytes when only 2 are present, resulting in error value 0. - constexpr size_t ReadErrorValue = 0; + const size_t ReadErrorValue = 0; EXPECT_EQ(ReadErrorValue, Cursor.Read(32)); // Should be at eof now. EXPECT_TRUE(Cursor.AtEndOfStream()); + + delete[] Text; } TEST(BitReaderTest, MateralizeForwardRefWithStream) {