[all-commits] [llvm/llvm-project] 6aa852: [RISCV] Fix parseBareSymbol to not double-parse to...

Jessica Clarke via All-commits all-commits at lists.llvm.org
Sun Feb 27 12:49:06 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6aa8521fdb7a551e32927cce71ecb0c424b51955
      https://github.com/llvm/llvm-project/commit/6aa8521fdb7a551e32927cce71ecb0c424b51955
  Author: Jessica Clarke <jrtc27 at jrtc27.com>
  Date:   2022-02-27 (Sun, 27 Feb 2022)

  Changed paths:
    M llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
    M llvm/test/MC/RISCV/rvi-pseudos.s

  Log Message:
  -----------
  [RISCV] Fix parseBareSymbol to not double-parse top-level operators

By failing to lex the token we end up both parsing it as a binary
operator ourselves and parsing it as a unary operator when calling
parseExpression on the RHS. For plus this is harmless but for minus this
parses "foo - 4" as "foo - -4", effectively treating a top-level minus
as a plus.

Fixes https://github.com/llvm/llvm-project/issues/54105

Reviewed By: asb, MaskRay

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




More information about the All-commits mailing list