This error can only happen if an unfinished operation is at Eof.
Patch by Brandon Jones
Differential Revision: https://reviews.llvm.org/D57379
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356972
91177308-0d34-0410-b5e6-
96231b3b80d8
case Match_MnemonicFail:
break;
}
+ if (Op.getToken().empty()) {
+ Error(IDLoc, "instruction must have size higher than 0", EmptyRange,
+ MatchingInlineAsm);
+ return true;
+ }
// FIXME: Ideally, we would only attempt suffix matches for things which are
// valid prefixes, and we could just infer the right unambiguous
--- /dev/null
+# RUN: not llvm-mc -triple i386-unknown-unknown %s 2>&1 > /dev/null| FileCheck %s --check-prefix=CHECK-ERROR
+
+#CHECK-ERROR: error: instruction must have size higher than 0
+ .byte 64;""
addl $a, %eax
# CHECK: addl $3, %eax
addl $1 + 2, %eax
-
+
# Disambiguation
# CHECK: addl $1, 8
addl $1, (%eax)
# CHECK: addl $1, 8(,%eax)
addl $1, (4+4)(,%eax)
-
+
# Indirect Memory Operands
# CHECK: addl $1, 1(%eax)
addl $1, 1(%eax)