Skip to content

Commit 1d31363

Browse files
Fix GetDebugInfoForCurrentMethod (#3113)
1 parent a1a1ae7 commit 1d31363

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.Llvm.DebugInfo.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,13 @@ internal sealed unsafe partial class CorInfoImpl
4444
private void GetDebugInfoForCurrentMethod(CORINFO_LLVM_METHOD_DEBUG_INFO* pInfo)
4545
{
4646
*pInfo = default;
47-
MethodDesc method = _methodCodeNode.Method;
47+
if (_debugInfo == null)
48+
{
49+
// The Jit may call us more than once (e. g. due to internal fallbacks).
50+
return;
51+
}
4852

53+
MethodDesc method = _methodCodeNode.Method;
4954
string documentPath = null;
5055
ArrayBuilder<CORINFO_LLVM_LINE_NUMBER_DEBUG_INFO> lineNumbersBuilder = default;
5156
foreach (ILSequencePoint sequencePoint in _debugInfo.GetSequencePoints())

0 commit comments

Comments
 (0)