diff options
author | Derek Schuff <dschuff@google.com> | 2012-02-29 00:07:09 +0000 |
---|---|---|
committer | Derek Schuff <dschuff@google.com> | 2012-02-29 00:07:09 +0000 |
commit | 0ffe6984297ece417e591003674d4466a201eb2a (patch) | |
tree | 36c68253615cfe2fad121876d7c1e47155e7a662 /lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | d0fff1886cbace4e663761f2c26dc0a5eed2b6b1 (diff) | |
download | external_llvm-0ffe6984297ece417e591003674d4466a201eb2a.zip external_llvm-0ffe6984297ece417e591003674d4466a201eb2a.tar.gz external_llvm-0ffe6984297ece417e591003674d4466a201eb2a.tar.bz2 |
Fix PR12080 by ensuring that MaterializeModule actually reads all the bitcode
in the streaming case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 8991549..e399040 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -2789,6 +2789,12 @@ bool BitcodeReader::MaterializeModule(Module *M, std::string *ErrInfo) { Materialize(F, ErrInfo)) return true; + // At this point, if there are any function bodies, the current bit is + // pointing to the END_BLOCK record after them. Now make sure the rest + // of the bits in the module have been read. + if (NextUnreadBit) + ParseModule(true); + // Upgrade any intrinsic calls that slipped through (should not happen!) and // delete the old functions to clean up. We can't do this unless the entire // module is materialized because there could always be another function body |