From 0ff1ab42f23d4efc043821ec447da5e553cd893e Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 30 Oct 2020 14:27:50 +0000 Subject: [PATCH] Use cast<> instead of dyn_cast<> as we dereference the pointer immediately. NFCI. Fix clang static analyzer warning - we know that the arg should be ConstantInt and we're better off relying on cast<> asserting on failure rather than a null dereference crash. --- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index ac25a0a..c8ec7ef 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -658,7 +658,7 @@ bool AArch64StackTagging::runOnFunction(Function &Fn) { IntrinsicInst *Start = Info.LifetimeStart[0]; IntrinsicInst *End = Info.LifetimeEnd[0]; uint64_t Size = - dyn_cast(Start->getArgOperand(0))->getZExtValue(); + cast(Start->getArgOperand(0))->getZExtValue(); Size = alignTo(Size, kTagGranuleSize); tagAlloca(AI, Start->getNextNode(), Start->getArgOperand(1), Size); // We need to ensure that if we tag some object, we certainly untag it -- 2.7.4