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 | 92ef975cc52069f5d96700f68aff9fda26021458 (patch) | |
tree | ab6cda74f1cad9e7bcb8ca75a0e08bd3f4c587ee /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | e646239e5e91176bcd9d54acbd7a37a6d722f9ae (diff) | |
download | bcm5719-llvm-92ef975cc52069f5d96700f68aff9fda26021458.tar.gz bcm5719-llvm-92ef975cc52069f5d96700f68aff9fda26021458.zip |
Fix PR12080 by ensuring that MaterializeModule actually reads all the bitcode
in the streaming case.
llvm-svn: 151676
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 899154971b8..e3990403bd7 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/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 |