From 5f32c01dead5623d874f442b34762f9d111be4cf Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 6 May 2007 19:27:46 +0000 Subject: [PATCH] fix off-by-one that caused the llvm2cpp test to fail git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36880 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bitcode/Reader/BitcodeReader.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index ffbd0e8a0e5..e9531f1e1d9 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -964,9 +964,11 @@ bool BitcodeReader::ParseModule(const std::string &ModuleID) { Section = SectionTable[Record[5]-1]; } GlobalValue::VisibilityTypes Visibility = GlobalValue::DefaultVisibility; - if (Record.size() >= 6) Visibility = GetDecodedVisibility(Record[6]); + if (Record.size() > 6) + Visibility = GetDecodedVisibility(Record[6]); bool isThreadLocal = false; - if (Record.size() >= 7) isThreadLocal = Record[7]; + if (Record.size() > 7) + isThreadLocal = Record[7]; GlobalVariable *NewGV = new GlobalVariable(Ty, isConstant, Linkage, 0, "", TheModule);