Skip to content

Commit f581d19

Browse files
committed
[AArch64] AArch64AsmParser::tryParseImmRange - don't directly dereference pointers from dyn_cast
Static analysis was reporting that dyn_cast<> can return null on failure - use cast<> instead
1 parent 4e6835d commit f581d19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8094,8 +8094,8 @@ ParseStatus AArch64AsmParser::tryParseImmRange(OperandVector &Operands) {
80948094
if (getParser().parseExpression(ImmL))
80958095
return ParseStatus::NoMatch;
80968096

8097-
unsigned ImmFVal = dyn_cast<MCConstantExpr>(ImmF)->getValue();
8098-
unsigned ImmLVal = dyn_cast<MCConstantExpr>(ImmL)->getValue();
8097+
unsigned ImmFVal = cast<MCConstantExpr>(ImmF)->getValue();
8098+
unsigned ImmLVal = cast<MCConstantExpr>(ImmL)->getValue();
80998099

81008100
Operands.push_back(
81018101
AArch64Operand::CreateImmRange(ImmFVal, ImmLVal, S, E, getContext()));

0 commit comments

Comments
 (0)