Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Unified Diff: lib/Bitcode/NaCl/TestUtils/NaClBitcodeMungeReader.cpp

Issue 1122423005: Add (unsupported experimental) feature allowing byte aligned bitcode. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Fix nits. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/Bitcode/NaCl/Reader/NaClBitstreamReader.cpp ('k') | lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Bitcode/NaCl/TestUtils/NaClBitcodeMungeReader.cpp
diff --git a/lib/Bitcode/NaCl/TestUtils/NaClBitcodeMungeReader.cpp b/lib/Bitcode/NaCl/TestUtils/NaClBitcodeMungeReader.cpp
index 6cab2f8ea08943a1cf6641cc9cc819acea66f2bd..3fbd17bb729b776db1f37d92c946b85d2abc59c8 100644
--- a/lib/Bitcode/NaCl/TestUtils/NaClBitcodeMungeReader.cpp
+++ b/lib/Bitcode/NaCl/TestUtils/NaClBitcodeMungeReader.cpp
@@ -131,14 +131,17 @@ void llvm::readNaClBitcodeRecordList(
const unsigned char *BufPtr =
(const unsigned char *) InputBuffer->getBufferStart();
const unsigned char *EndBufPtr = BufPtr + InputBuffer->getBufferSize();
- const unsigned char *HeaderPtr = BufPtr;
// Read header and verify it is good.
NaClBitcodeHeader Header;
- if (Header.Read(HeaderPtr, EndBufPtr) || !Header.IsSupported())
+ if (Header.Read(BufPtr, EndBufPtr))
+ report_fatal_error("Invalid PNaCl bitcode header.\n");
+ if (!Header.IsSupported())
+ errs() << Header.Unsupported();
+ if (!Header.IsReadable())
report_fatal_error("Invalid PNaCl bitcode header.\n");
- NaClBitstreamReader Reader(BufPtr, EndBufPtr, Header.getHeaderSize());
+ NaClBitstreamReader Reader(BufPtr, EndBufPtr, Header);
NaClBitstreamCursor Cursor(Reader);
// Parse the bitcode buffer.
« no previous file with comments | « lib/Bitcode/NaCl/Reader/NaClBitstreamReader.cpp ('k') | lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698