diff --git a/src/coreclr/jit/codegenarm64.cpp b/src/coreclr/jit/codegenarm64.cpp index ca810ddd1b77b0..b13c11c50d6681 100644 --- a/src/coreclr/jit/codegenarm64.cpp +++ b/src/coreclr/jit/codegenarm64.cpp @@ -1454,6 +1454,10 @@ void CodeGen::genFuncletProlog(BasicBlock* block) if (compiler->opts.IsOSR()) { + // With OSR we may see large values for fiSpDelta1. + // We repurpose genAllocLclFram to do the necessary probing. + bool scratchRegIsZero = false; + genAllocLclFrame(-genFuncletInfo.fiSpDelta1, REG_SCRATCH, &scratchRegIsZero, maskArgRegsLiveIn); genStackPointerAdjustment(genFuncletInfo.fiSpDelta1, REG_SCRATCH, nullptr, /* reportUnwindData */ true); } else