summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Reader/Reader.cpp
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
commit6a218134e318bcb91d1e9e99470bc865ccec8ced (patch)
treeb43e9620a951484ddf4abc5bca3bba22eb8199a4 /llvm/lib/Bytecode/Reader/Reader.cpp
parented5f67f424f47c779bc57393320901e97938872d (diff)
downloadbcm5719-llvm-6a218134e318bcb91d1e9e99470bc865ccec8ced.tar.gz
bcm5719-llvm-6a218134e318bcb91d1e9e99470bc865ccec8ced.zip
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. llvm-svn: 14728
Diffstat (limited to 'llvm/lib/Bytecode/Reader/Reader.cpp')
-rw-r--r--llvm/lib/Bytecode/Reader/Reader.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Bytecode/Reader/Reader.cpp b/llvm/lib/Bytecode/Reader/Reader.cpp
index 14f6c9f7e27..1b11f22e5cf 100644
--- a/llvm/lib/Bytecode/Reader/Reader.cpp
+++ b/llvm/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);
}
OpenPOWER on IntegriCloud