Index: test/MC/RISCV/rv32i-fuzzed-invalid.s =================================================================== --- /dev/null +++ test/MC/RISCV/rv32i-fuzzed-invalid.s @@ -0,0 +1,8 @@ +# REQUIRES: asserts +# RUN: not llvm-mc -triple riscv32 < %s 2>&1 | FileCheck %s +# +# Fuzzed test cases produced by a LLVM MC Assembler +# Protocol Buffer Fuzzer for the RISC-V assembly language. +# + +jal x13 # CHECK: error: immediate must be a multiple of 2 bytes in the range [-1048576, 1048574] Index: utils/TableGen/AsmMatcherEmitter.cpp =================================================================== --- utils/TableGen/AsmMatcherEmitter.cpp +++ utils/TableGen/AsmMatcherEmitter.cpp @@ -3545,7 +3545,8 @@ OS << " continue;\n"; } else { OS << " OperandsValid = (Formal == InvalidMatchClass) || isSubclass(Formal, OptionalMatchClass);\n"; - OS << " if (!OperandsValid) ErrorInfo = ActualIdx;\n"; + OS << " if (!OperandsValid)\n"; + OS << " break;\n"; if (HasOptionalOperands) { OS << " OptionalOperandsMask.set(FormalIdx, " << MaxNumOperands << ");\n";