Fixes PR34998.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316282
91177308-0d34-0410-b5e6-
96231b3b80d8
if (readModRM(insn))
return -1;
+ // Reject if SIB wasn't used.
+ if (insn->eaBase != EA_BASE_sib && insn->eaBase != EA_BASE_sib64)
+ return -1;
+
// If sibIndex was set to SIB_INDEX_NONE, index offset is 4.
if (insn->sibIndex == SIB_INDEX_NONE)
insn->sibIndex = (SIBIndex)4;
--- /dev/null
+# RUN: llvm-mc --disassemble %s -triple=x86_64-apple-darwin9 2>&1 | grep "invalid instruction encoding"
+
+// This corresponds to a gather, but doesn't use a SIB byte.
+0xc4,0xe2,0xe9,0x92,0x08