reject invalid comma stuff with a message. We reject the case in
[oota-llvm.git] / lib / AsmParser / LLParser.cpp
index aa887d21777973b4c9840bb748390c06fa799131..45b88cc2a55427f4e57f634f09b937915a5e6802 100644 (file)
@@ -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;