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

Unified Diff: include/llvm/Bitcode/NaCl/NaClBitstreamWriter.h

Issue 1139673004: Harden writer of munged bitcode for fuzzing (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Fix issues in last patch. 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 | « include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h ('k') | lib/Bitcode/NaCl/TestUtils/NaClBitcodeMunge.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/llvm/Bitcode/NaCl/NaClBitstreamWriter.h
diff --git a/include/llvm/Bitcode/NaCl/NaClBitstreamWriter.h b/include/llvm/Bitcode/NaCl/NaClBitstreamWriter.h
index 01c490627594fb4d7fcc017cb691243c514d9579..e3e84e672b35929b1b4778028f45395861ddfad1 100644
--- a/include/llvm/Bitcode/NaCl/NaClBitstreamWriter.h
+++ b/include/llvm/Bitcode/NaCl/NaClBitstreamWriter.h
@@ -148,6 +148,12 @@ public:
/// \brief Retrieve the current position in the stream, in bits.
uint64_t GetCurrentBitNo() const { return GetBufferOffset() * 8 + CurBit; }
+ /// \brief Returns the maximum abbreviation index allowed for the
+ /// current block.
+ size_t getMaxCurAbbrevIndex() const {
+ return CurAbbrevs.size() + naclbitc::DEFAULT_MAX_ABBREV;
+ }
+
//===--------------------------------------------------------------------===//
// Basic Primitives for emitting bits to the stream.
//===--------------------------------------------------------------------===//
« no previous file with comments | « include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h ('k') | lib/Bitcode/NaCl/TestUtils/NaClBitcodeMunge.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698