[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
Sat Mar 2 22:42:15 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:
https://llvm.org/docs/CodingStandards.html#error-and-warning-messages
"the size ... " (remove trailing period)
https://github.com/llvm/llvm-project/pull/83708
More information about the llvm-commits
mailing list