Skip to content

Commit

Permalink
BitcodeReader: Require clients to read the block info block at most o…
Browse files Browse the repository at this point in the history
…nce.

This change makes it the client's responsibility to call ReadBlockInfoBlock()
at most once. This is in preparation for a future change that will allow
there to be multiple block info blocks.

See also: http://lists.llvm.org/pipermail/llvm-dev/2016-October/106512.html

Differential Revision: https://reviews.llvm.org/D26016

llvm-svn: 285350
  • Loading branch information
pcc committed Oct 27, 2016
1 parent 80de16f commit fc0a99b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Bitcode/Reader/BitstreamReader.cpp
Expand Up @@ -319,9 +319,9 @@ void BitstreamCursor::ReadAbbrevRecord() {
}

bool BitstreamCursor::ReadBlockInfoBlock() {
// If this is the second stream to get to the block info block, skip it.
// We expect the client to read the block info block at most once.
if (getBitStreamReader()->hasBlockInfoRecords())
return SkipBlock();
report_fatal_error("Duplicate read of block info block");

if (EnterSubBlock(bitc::BLOCKINFO_BLOCK_ID)) return true;

Expand Down

0 comments on commit fc0a99b

Please sign in to comment.