diff options
Diffstat (limited to 'lib/VMCore/Type.cpp')
-rw-r--r-- | lib/VMCore/Type.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index 4554826c34..829923e15a 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -1252,9 +1252,10 @@ StructType *StructType::get(const Type *type, ...) { va_list ap; std::vector<const llvm::Type*> StructFields; va_start(ap, type); - do { + while (type) { StructFields.push_back(type); - } while ((type = va_arg(ap, llvm::Type*))); + type = va_arg(ap, llvm::Type*); + } return llvm::StructType::get(StructFields); } |