[llvm] [RISCV] Stack clash protection for dynamic alloca (PR #122508)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 10 16:31:02 PST 2025


================
@@ -639,6 +649,15 @@ void RISCVFrameLowering::allocateStack(MachineBasicBlock &MBB,
   DebugLoc DL;
   const RISCVRegisterInfo *RI = STI.getRegisterInfo();
   const RISCVInstrInfo *TII = STI.getInstrInfo();
+  bool IsRV64 = STI.is64Bit();
+  bool dyn_alloca = false;
+
+  // If we have a dynamic allocation later we need to probe any residuals.
+  if (NeedProbe) {
+    MachineBasicBlock *NextMBB = MBBI->getParent()->getSingleSuccessor();
+    dyn_alloca = (NextMBB != NULL &&
----------------
topperc wrote:

Don't use NULL

https://github.com/llvm/llvm-project/pull/122508


More information about the llvm-commits mailing list