diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2016-10-27 21:39:28 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-10-27 21:39:28 +0000 |
commit | fc0a99bfda0b18458bbbf5605be0aac3b83e038a (patch) | |
tree | e859351bf1612a0791e9fd4bcef1b81e44eb1449 /llvm/lib/Bitcode/Reader/BitstreamReader.cpp | |
parent | 80de16f65319d7a091f8eb7123fa80259f0520ba (diff) | |
download | bcm5719-llvm-fc0a99bfda0b18458bbbf5605be0aac3b83e038a.tar.gz bcm5719-llvm-fc0a99bfda0b18458bbbf5605be0aac3b83e038a.zip |
BitcodeReader: Require clients to read the block info block at most once.
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
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitstreamReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitstreamReader.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitstreamReader.cpp b/llvm/lib/Bitcode/Reader/BitstreamReader.cpp index 330bc045cc6..0b549f7550f 100644 --- a/llvm/lib/Bitcode/Reader/BitstreamReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitstreamReader.cpp @@ -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; |