Skip to content

Commit 0ff1ab4

Browse files
committed
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.
1 parent 5bf45ee commit 0ff1ab4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/AArch64/AArch64StackTagging.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ bool AArch64StackTagging::runOnFunction(Function &Fn) {
658658
IntrinsicInst *Start = Info.LifetimeStart[0];
659659
IntrinsicInst *End = Info.LifetimeEnd[0];
660660
uint64_t Size =
661-
dyn_cast<ConstantInt>(Start->getArgOperand(0))->getZExtValue();
661+
cast<ConstantInt>(Start->getArgOperand(0))->getZExtValue();
662662
Size = alignTo(Size, kTagGranuleSize);
663663
tagAlloca(AI, Start->getNextNode(), Start->getArgOperand(1), Size);
664664
// We need to ensure that if we tag some object, we certainly untag it

0 commit comments

Comments
 (0)