This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][MC] Reject bare symbols for the simm6 and simm6nonzero operand types
ClosedPublic

Authored by apazos on Sep 12 2018, 3:26 PM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

apazos created this revision.Sep 12 2018, 3:26 PM
asb accepted this revision.Sep 13 2018, 7:27 AM

Thanks, looks good to me. Note that the IsValid local variables can now be removed.

lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
330 ↗(On Diff #165170)

IsValid can now be deleted.

341 ↗(On Diff #165170)

IsValid can now be deleted.

This revision is now accepted and ready to land.Sep 13 2018, 7:27 AM
apazos updated this revision to Diff 165338.Sep 13 2018, 11:27 AM

Removed unused var.

This revision was automatically updated to reflect the committed changes.