[llvm] [AArch64] Reject non-constant expressions in tryParseAdjImm0_63 (PR #183246)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 11 02:49:29 PDT 2026
================
@@ -8934,7 +8934,10 @@ ParseStatus AArch64AsmParser::tryParseAdjImm0_63(OperandVector &Operands) {
if (getParser().parseExpression(Ex))
return ParseStatus::NoMatch;
- int64_t Imm = dyn_cast<MCConstantExpr>(Ex)->getValue();
+ const MCConstantExpr *Value = dyn_cast<MCConstantExpr>(Ex);
+ if (check(!Value, S, "expected constant expression"))
----------------
CarolineConcatto wrote:
Can we use parseImmExpr here instead?
I would try to keep the pattern in here and use ParseStatus::NoMatch; instead of ParseStatus::Failure;
https://github.com/llvm/llvm-project/pull/183246
More information about the llvm-commits
mailing list