fix off-by-one that caused the llvm2cpp test to fail
authorChris Lattner <sabre@nondot.org>
Sun, 6 May 2007 19:27:46 +0000 (19:27 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 6 May 2007 19:27:46 +0000 (19:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36880 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bitcode/Reader/BitcodeReader.cpp

index ffbd0e8a0e5e54d32fad46b206d8720821e6e8de..e9531f1e1d916b13da33df580445adee933ebcb4 100644 (file)
@@ -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);