llvm-project
b54d214b - [llvm][RISCV][MC] Fix arithmetic error in pseudo parsing (#200217)

Commit
78 days ago
[llvm][RISCV][MC] Fix arithmetic error in pseudo parsing (#200217) When arithmetic was used in RISCV pseudo instructions, like lla, the custom parsing breaks the associativity of the operators by parsing the entire remainder of an expression. This would lead to scenarios where we would parse `top - 0x100 -0x10` as `top - (0x100 -0x10)` and yield the wrong offset (`0xF0`(wrong) vs. `0x110`(correct)). Instead, don't advance the parser and just examine the token to determine if it's an identifier and if we should handle this case or bail out. In cases we do handle, just use `parseExpression()`, which will handle this correctly.
Author
Parents
Loading