Index: lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp |
diff --git a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp |
index fca2ee760e09af1c50b2356626c1931c8b8e191b..c4cae2ca8165aaa73ddcda0a9bbaaf6036e54ee3 100644 |
--- a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp |
+++ b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp |
@@ -1844,16 +1844,15 @@ std::error_code NaClBitcodeReader::InitStreamFromBuffer() { |
return Error(InvalidBitstream, |
"Bitcode stream should be a multiple of 4 bytes in length"); |
- const unsigned char *HeaderPtr = BufPtr; |
- if (Header.Read(HeaderPtr, BufEnd)) |
+ if (Header.Read(BufPtr, BufEnd)) |
return Error(InvalidBitstream, Header.Unsupported()); |
- StreamFile.reset(new NaClBitstreamReader(BufPtr, BufEnd, |
- Header.getHeaderSize())); |
- Stream.init(StreamFile.get()); |
- |
if (AcceptHeader()) |
return Error(InvalidBitstream, Header.Unsupported()); |
+ |
+ StreamFile.reset(new NaClBitstreamReader(BufPtr, BufEnd, Header)); |
+ Stream.init(StreamFile.get()); |
+ |
return std::error_code(); |
} |
@@ -1861,11 +1860,11 @@ std::error_code NaClBitcodeReader::InitLazyStream() { |
if (Header.Read(LazyStreamer)) |
return Error(InvalidBitstream, Header.Unsupported()); |
- StreamFile.reset(new NaClBitstreamReader(LazyStreamer, |
- Header.getHeaderSize())); |
- Stream.init(StreamFile.get()); |
if (AcceptHeader()) |
return Error(InvalidBitstream, Header.Unsupported()); |
+ |
+ StreamFile.reset(new NaClBitstreamReader(LazyStreamer, Header)); |
+ Stream.init(StreamFile.get()); |
return std::error_code(); |
} |