aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-07-09 21:13:53 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-07-09 21:13:53 +0000
commit011bed5ef836fa92e750d21e124158592192f5f4 (patch)
treea55cbdf0fc9cd222dcc32bdf0e5aea6dcc2c2922 /lib/Bytecode
parent20d20fc77d3da95c52b9ce57799afde1d44f7456 (diff)
Fix a backwards compatibility bug found by Tanya. In version 1.2, the
global type plane starts with a length and the TypeTyID value to identify the type plane has having type definitions. This doesn't happen in 1.3 because the types are read from a known position in the file. However, the TypeTyID must be read in (and ignored) if its a 1.2 bytecode file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14728 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode')
-rw-r--r--lib/Bytecode/Reader/Reader.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index 14f6c9f7e2..1b11f22e5c 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/lib/Bytecode/Reader/Reader.cpp
@@ -1641,6 +1641,11 @@ void BytecodeReader::ParseAllFunctionBodies() {
void BytecodeReader::ParseGlobalTypes() {
// Read the number of types
unsigned NumEntries = read_vbr_uint();
+
+ // Ignore the type plane identifier for types if the bc file is pre 1.3
+ if (hasTypeDerivedFromValue)
+ read_vbr_uint();
+
ParseTypeConstants(ModuleTypes, NumEntries);
}