Skip to content
Permalink
Browse files

[AArch64] AArch64StackTagging - Silence static analyzer dyn_cast<> nu…

…ll dereference warning. NFCI.

The static analyzer is warning about potential null dereferences, but we should be able to use cast<> directly and if not assert will fire for us.

llvm-svn: 372507
  • Loading branch information
RKSimon committed Sep 22, 2019
1 parent 597ec24 commit 62ed3fea67072724e825101188a77e6cd2b57669
Showing with 1 addition and 1 deletion.
  1. +1 −1 llvm/lib/Target/AArch64/AArch64StackTagging.cpp
@@ -471,7 +471,7 @@ void AArch64StackTagging::alignAndPadAlloca(AllocaInfo &Info) {
Info.AI->isArrayAllocation()
? ArrayType::get(
Info.AI->getAllocatedType(),
dyn_cast<ConstantInt>(Info.AI->getArraySize())->getZExtValue())
cast<ConstantInt>(Info.AI->getArraySize())->getZExtValue())
: Info.AI->getAllocatedType();
Type *PaddingType =
ArrayType::get(Type::getInt8Ty(F->getContext()), AlignedSize - Size);

0 comments on commit 62ed3fe

Please sign in to comment.
You can’t perform that action at this time.