[SystemZ] lowerDYNAMIC_STACKALLOC_XPLINK - use cast<> instead of dyn_cast<> to avoid dereference of nullptr

The pointer is always dereferenced, so assert the cast is correct instead of returning nullptr
This commit is contained in:
Simon Pilgrim 2022-02-17 11:56:29 +00:00
parent ada6bcc13f
commit 5f4549c372
1 changed files with 1 additions and 1 deletions

View File

@ -3577,7 +3577,7 @@ SystemZTargetLowering::lowerDYNAMIC_STACKALLOC_XPLINK(SDValue Op,
// If user has set the no alignment function attribute, ignore
// alloca alignments.
uint64_t AlignVal =
(RealignOpt ? dyn_cast<ConstantSDNode>(Align)->getZExtValue() : 0);
(RealignOpt ? cast<ConstantSDNode>(Align)->getZExtValue() : 0);
uint64_t StackAlign = TFI->getStackAlignment();
uint64_t RequiredAlign = std::max(AlignVal, StackAlign);