OSDN Git Service

Allow structs with zero fields.
authorChris Lattner <sabre@nondot.org>
Sun, 6 May 2007 08:21:50 +0000 (08:21 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 6 May 2007 08:21:50 +0000 (08:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36862 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bitcode/Reader/BitcodeReader.cpp

index 2e9de1c..ffbd0e8 100644 (file)
@@ -326,7 +326,7 @@ bool BitcodeReader::ParseTypeTable() {
       break;
     }
     case bitc::TYPE_CODE_STRUCT: {  // STRUCT: [ispacked, eltty x N]
-      if (Record.size() < 2)
+      if (Record.size() < 1)
         return Error("Invalid STRUCT type record");
       std::vector<const Type*> EltTys;
       for (unsigned i = 1, e = Record.size(); i != e; ++i)