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.
This commit is contained in:
Simon Pilgrim 2020-10-30 14:27:50 +00:00
parent 5bf45ee156
commit 0ff1ab42f2
1 changed files with 1 additions and 1 deletions

View File

@ -658,7 +658,7 @@ bool AArch64StackTagging::runOnFunction(Function &Fn) {
IntrinsicInst *Start = Info.LifetimeStart[0];
IntrinsicInst *End = Info.LifetimeEnd[0];
uint64_t Size =
dyn_cast<ConstantInt>(Start->getArgOperand(0))->getZExtValue();
cast<ConstantInt>(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