[llvm] r229365 - AsmParser: extractvalue requires at least one index operand

David Majnemer david.majnemer at gmail.com
Mon Feb 16 01:18:13 PST 2015


Author: majnemer
Date: Mon Feb 16 03:18:13 2015
New Revision: 229365

URL: http://llvm.org/viewvc/llvm-project?rev=229365&view=rev
Log:
AsmParser: extractvalue requires at least one index operand

Added:
    llvm/trunk/test/Assembler/extractvalue-no-idx.ll
Modified:
    llvm/trunk/lib/AsmParser/LLParser.cpp

Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=229365&r1=229364&r2=229365&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Mon Feb 16 03:18:13 2015
@@ -1633,6 +1633,7 @@ bool LLParser::ParseIndexList(SmallVecto
 
   while (EatIfPresent(lltok::comma)) {
     if (Lex.getKind() == lltok::MetadataVar) {
+      if (Indices.empty()) return TokError("expected index");
       AteExtraComma = true;
       return false;
     }

Added: llvm/trunk/test/Assembler/extractvalue-no-idx.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/extractvalue-no-idx.ll?rev=229365&view=auto
==============================================================================
--- llvm/trunk/test/Assembler/extractvalue-no-idx.ll (added)
+++ llvm/trunk/test/Assembler/extractvalue-no-idx.ll Mon Feb 16 03:18:13 2015
@@ -0,0 +1,8 @@
+; RUN: not llvm-as < %s 2>&1 | FileCheck %s
+
+; CHECK: expected index
+
+define void @f1() {
+  extractvalue <{ i32, i32 }> undef, !dbg !0
+  ret void
+}





More information about the llvm-commits mailing list