[Bitcode] AtEndOfStream should only check against the size if it's known.
authorJordan Rose <jordan_rose@apple.com>
Thu, 13 Nov 2014 00:08:41 +0000 (00:08 +0000)
committerJordan Rose <jordan_rose@apple.com>
Thu, 13 Nov 2014 00:08:41 +0000 (00:08 +0000)
commit2217648f91a3ec227f249b98c0517a77ec6921d7
treed6a10160188748f9d87210ed72a993eeb3bd35b0
parentde87c9165ae2afb696fcd10bdd18e97756624e09
[Bitcode] AtEndOfStream should only check against the size if it's known.

This avoids an issue where AtEndOfStream mistakenly returns true at the /start/ of
a stream.

(In the rare case that the size is known and actually 0, the slow path will still
handle it correctly.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221840 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Bitcode/BitstreamReader.h
unittests/Bitcode/BitstreamReaderTest.cpp [new file with mode: 0644]
unittests/Bitcode/CMakeLists.txt