From 313baef638104ed64f93e077c84547421884c91b Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Wed, 19 Jan 2022 13:16:28 +0300 Subject: [PATCH] JIT: Fix repeatable failure for max CALLSITE_DEPTH (#63966) --- src/coreclr/jit/fginline.cpp | 4 +++- .../JitBlue/Runtime_63942/Runtime_63942.cs | 13 ++++++++++++ .../Runtime_63942/Runtime_63942.csproj | 21 +++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/tests/JIT/Regression/JitBlue/Runtime_63942/Runtime_63942.cs create mode 100644 src/tests/JIT/Regression/JitBlue/Runtime_63942/Runtime_63942.csproj diff --git a/src/coreclr/jit/fginline.cpp b/src/coreclr/jit/fginline.cpp index aaf40cefbfd..53566eb17de 100644 --- a/src/coreclr/jit/fginline.cpp +++ b/src/coreclr/jit/fginline.cpp @@ -47,7 +47,9 @@ unsigned Compiler::fgCheckInlineDepthAndRecursion(InlineInfo* inlineInfo) // This inline candidate has the same IL code buffer as an already // inlined method does. inlineResult->NoteFatal(InlineObservation::CALLSITE_IS_RECURSIVE); - break; + + // No need to note CALLSITE_DEPTH we're already rejecting this candidate + return depth; } if (depth > InlineStrategy::IMPLEMENTATION_MAX_INLINE_DEPTH) diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_63942/Runtime_63942.cs b/src/tests/JIT/Regression/JitBlue/Runtime_63942/Runtime_63942.cs new file mode 100644 index 00000000000..a4abd8fd4bf --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_63942/Runtime_63942.cs @@ -0,0 +1,13 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// Found by Antigen + +public class Runtime_63942 +{ + public static int Main() + { + var _ = 3.14.ToString(); + return 100; + } +} diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_63942/Runtime_63942.csproj b/src/tests/JIT/Regression/JitBlue/Runtime_63942/Runtime_63942.csproj new file mode 100644 index 00000000000..9756f0815d4 --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_63942/Runtime_63942.csproj @@ -0,0 +1,21 @@ + + + Exe + True + + + + + + + \ No newline at end of file -- GitLab