[PATCH] D11391: Fix testing for end of stream in bitstream reader.

Karl Schimpf kschimpf at google.com
Thu Jul 30 09:43:34 PDT 2015


kschimpf added a comment.

Note that I had to add a  few zero-valued bytes to the end of (binary) test case test/Bitcode/Input/invalid-abbrev.bc. These zeros are needed to correctly make the bitcode reader terminate (it wasn't reading the last byte correctly due to eof bug fixed by this CL).


================
Comment at: include/llvm/Support/StreamingMemoryObject.h:56
@@ +55,3 @@
+  /// The number of bytes read at a time from the data streamer.
+  static constexpr uint32_t kChunkSize = 4096 * 4;
+
----------------
rafael wrote:
> I don't think constexpr is supported everywhere. Why do you need it?
It isn't necessary. removing.

================
Comment at: unittests/Bitcode/BitReaderTest.cpp:109
@@ +108,3 @@
+  // Build bitsteam reader using data streamer.
+  auto MemoryBuf = MemoryBuffer::getMemBuffer(std::move(Input));
+  std::unique_ptr<DataStreamer>
----------------
filcab wrote:
> Why std::move() a StringRef?
This is a leftover from when I created the memory buffer using a different constructor of a memory buffer. Removing.



http://reviews.llvm.org/D11391







More information about the llvm-commits mailing list