From eb99789fefa3115ce1dbc6e2250c990cb6c15709 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 6 May 2007 08:12:09 +0000 Subject: [PATCH] we aren't at the end of stream until we've consumed all the bytes AND all the bits in those bytes. llvm-svn: 36861 --- llvm/include/llvm/Bitcode/BitstreamReader.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/Bitcode/BitstreamReader.h b/llvm/include/llvm/Bitcode/BitstreamReader.h index 6f028fba0009..86a26c2c20e7 100644 --- a/llvm/include/llvm/Bitcode/BitstreamReader.h +++ b/llvm/include/llvm/Bitcode/BitstreamReader.h @@ -101,7 +101,9 @@ public: } } - bool AtEndOfStream() const { return NextChar == LastChar; } + bool AtEndOfStream() const { + return NextChar == LastChar && BitsInCurWord == 0; + } /// GetCurrentBitNo - Return the bit # of the bit we are reading. uint64_t GetCurrentBitNo() const {