Index: tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp |
diff --git a/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp b/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp |
index de14a6d1af38c90b981fe8ab155b646921c78057..84a63a1e5c9829684933a5f6e1e6a66f5296516c 100644 |
--- a/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp |
+++ b/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp |
@@ -476,13 +476,13 @@ static int AnalyzeBitcode() { |
if (MemBuf->getBufferSize() & 3) |
return Error("Bitcode stream should be a multiple of 4 bytes in length"); |
- unsigned char *BufPtr = (unsigned char *)MemBuf->getBufferStart(); |
- unsigned char *EndBufPtr = BufPtr+MemBuf->getBufferSize(); |
+ const unsigned char *BufPtr = (unsigned char *)MemBuf->getBufferStart(); |
+ const unsigned char *EndBufPtr = BufPtr+MemBuf->getBufferSize(); |
// If we have a wrapper header, parse it and ignore the non-bc file contents. |
// The magic number is 0x0B17C0DE stored in little endian. |
if (isBitcodeWrapper(BufPtr, EndBufPtr)) |
- if (SkipBitcodeWrapperHeader(BufPtr, EndBufPtr)) |
+ if (SkipBitcodeWrapperHeader(BufPtr, EndBufPtr, true)) |
return Error("Invalid bitcode wrapper header"); |
BitstreamReader StreamFile(BufPtr, EndBufPtr); |