Skip to content

Commit 7dca372

Browse files
committed
Fix IndexOutOfRangeException when disassembling Debug assembly.
1 parent 3cbd6dc commit 7dca372

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/BenchmarkDotNet/Disassemblers/SourceCodeProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public void Dispose()
2222
internal IEnumerable<Sharp> GetSource(ClrMethod method, ILToNativeMap map)
2323
{
2424
var sourceLocation = GetSourceLocation(method, map.ILOffset);
25-
if (sourceLocation == null)
25+
if (sourceLocation is not { LineNumber: > 0 })
2626
yield break;
2727

2828
for (int line = sourceLocation.LineNumber; line <= sourceLocation.LineNumberEnd; ++line)

0 commit comments

Comments
 (0)