Page MenuHomePhabricator

[RISCV][MC] Improve parsing of jal/j operands

Authored by asb on Sep 13 2018, 5:53 AM.



Examples such as jal a3, j a3 and jal a3, a3 were previously accepted by gas but rejected by LLVM MC. This patch rectifies this. I introduce RISCVAsmParser::parseJALOffset to ensure that symbol names that coincide with register names can safely be parsed. This is made a somewhat fiddly due to the single-operand alias form (see the comment in parseJALOffset for more info).

Diff Detail


Event Timeline

asb created this revision.Sep 13 2018, 5:53 AM

I ran the fuzzer with this patch. No issues detected, LGTM.

This revision was not accepted when it landed; it landed in state Needs Review.Sep 20 2018, 1:12 AM
Closed by commit rL342629: [RISCV][MC] Improve parsing of jal/j operands (authored by asb, committed by ). · Explain Why
This revision was automatically updated to reflect the committed changes.