[RISCV][MC] Reject bare symbols for the simm6 and simm6nonzero operand types
authorAna Pazos <apazos@codeaurora.org>
Thu, 13 Sep 2018 18:37:23 +0000 (18:37 +0000)
committerAna Pazos <apazos@codeaurora.org>
Thu, 13 Sep 2018 18:37:23 +0000 (18:37 +0000)
commit065b088759c2f3b1e92743008fd0a6eed3ff5290
treedf11f1d7014a54186fa7ea29243ad9f8c21f5796
parentb0799dda77c6b75526e1415331e2a9656abd6f95
 [RISCV][MC] Reject bare symbols for the simm6 and simm6nonzero operand types

Summary:
Fixed assertions due to invalid fixup when encoding compressed instructions
 (c.addi, c.addiw, c.li, c.andi) with bare symbols with/without modifiers.
  This matches GAS behavior as well.

This bug was uncovered by a LLVM MC Disassembler Protocol Buffer Fuzzer
for the RISC-V assembly language.

Reviewers: asb

Reviewed By: asb

Subscribers: rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, mgrang, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, asb

Differential Revision: https://reviews.llvm.org/D52005

llvm-svn: 342160
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/test/MC/RISCV/rv32c-invalid.s
llvm/test/MC/RISCV/rv64c-invalid.s