[llvm] [X86][MC] Report error when the instruction length exceeds 15 bytes (PR #83708)

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 3 18:45:24 PST 2024


================
@@ -1924,8 +1924,9 @@ void X86MCCodeEmitter::encodeInstruction(const MCInst &MI,
   if ((TSFlags & X86II::OpMapMask) == X86II::ThreeDNow)
     emitByte(X86II::getBaseOpcodeFor(TSFlags), CB);
 
-  assert(CB.size() - StartByte <= 15 &&
-         "The size of instruction must be no longer than 15.");
+  if (CB.size() - StartByte > 15)
+    Ctx.reportError(MI.getLoc(),
----------------
KanRobert wrote:

Done

https://github.com/llvm/llvm-project/pull/83708


More information about the llvm-commits mailing list