From 452e2627dc1de4fb5a2b1c9ac999f1b3396f82c7 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 28 Feb 2009 18:12:41 +0000 Subject: [PATCH] reject 0 element vectors with: @a = internal constant void bitcast(<0 x i8> <> to void) ^ Fixes PR3685 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65698 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AsmParser/LLParser.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index abddc59bde1..85b4966a7bd 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -1262,6 +1262,8 @@ bool LLParser::ParseArrayVectorType(PATypeHolder &Result, bool isVector) { return true; if (isVector) { + if (Size == 0) + return Error(SizeLoc, "zero element vector is illegal"); if ((unsigned)Size != Size) return Error(SizeLoc, "size too large for vector"); if (!EltTy->isFloatingPoint() && !EltTy->isInteger())