JIT: Properly mark compilation as having throw helpers in debug codegen (#79504)
authorJakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Wed, 14 Dec 2022 21:00:56 +0000 (22:00 +0100)
committerGitHub <noreply@github.com>
Wed, 14 Dec 2022 21:00:56 +0000 (22:00 +0100)
Otherwise we may fail to allocate the outgoing arg area and align the
stack properly.

Fix #78092

src/coreclr/jit/morph.cpp

index 20f6238..57d1794 100644 (file)
@@ -4264,6 +4264,14 @@ BasicBlock* Compiler::fgSetRngChkTargetInner(SpecialCodeKind kind, bool delay)
             return fgRngChkTarget(compCurBB, kind);
         }
     }
+    else
+    {
+        // Tell downstream code that we will end up with a call so that it
+        // knows this is not a leaf function. For optimized code this is
+        // handled by fgRngChkTarget that is called above either in morph or
+        // simple lowering.
+        compUsesThrowHelper = true;
+    }
 
     return nullptr;
 }