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

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 3 23:06:04 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(),
----------------
MaskRay wrote:

gas has a slightly different diagnostic. Consider matching it? 
https://sourceware.org/bugzilla/show_bug.cgi?id=31323

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


More information about the llvm-commits mailing list