diff options
author | Chris Lattner <sabre@nondot.org> | 2004-01-15 17:55:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-01-15 17:55:01 +0000 |
commit | 7c73b19bb8094627702375431156cf4ffc58e355 (patch) | |
tree | 6dd008b622c93320c9073d4a888013c4ec6d7f25 /llvm/lib/Bytecode/Reader/Reader.cpp | |
parent | f63a4ecc0b4d2f4bd73d451c18a9b4ee62e46048 (diff) | |
download | bcm5719-llvm-7c73b19bb8094627702375431156cf4ffc58e355.tar.gz bcm5719-llvm-7c73b19bb8094627702375431156cf4ffc58e355.zip |
Fix PR73
llvm-svn: 10875
Diffstat (limited to 'llvm/lib/Bytecode/Reader/Reader.cpp')
-rw-r--r-- | llvm/lib/Bytecode/Reader/Reader.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/Bytecode/Reader/Reader.cpp b/llvm/lib/Bytecode/Reader/Reader.cpp index 508fb7730a9..bc84135a96f 100644 --- a/llvm/lib/Bytecode/Reader/Reader.cpp +++ b/llvm/lib/Bytecode/Reader/Reader.cpp @@ -499,7 +499,8 @@ void BytecodeParser::ParseModuleGlobalInfo(const unsigned char *&Buf, BCR_TRACE(2, "Function of type: " << Ty << "\n"); } - align32(Buf, End); + if (hasInconsistentModuleGlobalInfo) + align32(Buf, End); // Now that the function signature list is set up, reverse it so that we can // remove elements efficiently from the back of the vector. @@ -530,6 +531,7 @@ void BytecodeParser::ParseVersionInfo(const unsigned char *&Buf, hasExtendedLinkageSpecs = true; hasOldStyleVarargs = false; hasVarArgCallPadding = false; + hasInconsistentModuleGlobalInfo = false; FirstDerivedTyID = 14; switch (RevisionNum) { @@ -539,15 +541,22 @@ void BytecodeParser::ParseVersionInfo(const unsigned char *&Buf, hasExtendedLinkageSpecs = false; hasOldStyleVarargs = true; hasVarArgCallPadding = true; + hasInconsistentModuleGlobalInfo = true; + break; case 0: // LLVM 1.0, 1.1 release version // Compared to rev #2, we added support for weak linkage, a more dense // encoding, and better varargs support. // Base LLVM 1.0 bytecode format. + hasInconsistentModuleGlobalInfo = true; break; case 1: // LLVM 1.2 release version // LLVM 1.2 added explicit support for emitting strings efficiently. + + // Also, it fixed the problem where the size of the ModuleGlobalInfo block + // included the size for the alignment at the end, where the rest of the + // blocks did not. break; default: |