From ac3d4d15a44f0fff0a66df25c371ec5c922f6991 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 23 Apr 2010 00:50:50 +0000 Subject: [PATCH] reject invalid comma stuff with a message. We reject the case in PR6888 with: $ llvm-as t.ll llvm-as: t.ll:2:29: error: expected metadata or 'align' store <3 x i32> %x, i32 1, i32 1>, <3 x i32>* %p ^ instead of: $ llvm-as t.ll llvm-as: llvm-svn: 102154 --- lib/AsmParser/LLParser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index aa887d21777..45b88cc2a55 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -1170,10 +1170,10 @@ bool LLParser::ParseOptionalCommaAlign(unsigned &Alignment, return false; } - if (Lex.getKind() == lltok::kw_align) { - if (ParseOptionalAlignment(Alignment)) return true; - } else - return true; + if (Lex.getKind() != lltok::kw_align) + return Error(Lex.getLoc(), "expected metadata or 'align'"); + + if (ParseOptionalAlignment(Alignment)) return true; } return false;