Skip to content

Commit

Permalink
Fix issue 98506 - Excessive exceptions generated in StackTraceSymbols (
Browse files Browse the repository at this point in the history
…#105530)

* Fix issue 98506 - Excessive exceptions generated in StackTraceSymbols

* Code review feedback
  • Loading branch information
mikem8361 authored Jul 26, 2024
1 parent ef1ccab commit 8e3896b
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ internal void GetSourceLineInfo(Assembly assembly, string assemblyPath, IntPtr l
sourceLine = 0;
sourceColumn = 0;

MetadataReader? reader = TryGetReader(assembly, assemblyPath, loadedPeAddress, loadedPeSize, isFileLayout, inMemoryPdbAddress, inMemoryPdbSize);
if (reader != null)
Handle handle = MetadataTokens.Handle(methodToken);
if (!handle.IsNil && handle.Kind == HandleKind.MethodDefinition)
{
Handle handle = MetadataTokens.Handle(methodToken);

if (handle.Kind == HandleKind.MethodDefinition)
MetadataReader? reader = TryGetReader(assembly, assemblyPath, loadedPeAddress, loadedPeSize, isFileLayout, inMemoryPdbAddress, inMemoryPdbSize);
if (reader != null)
{
MethodDebugInformationHandle methodDebugHandle = ((MethodDefinitionHandle)handle).ToDebugInformationHandle();
MethodDebugInformation methodInfo = reader.GetMethodDebugInformation(methodDebugHandle);
Expand Down

0 comments on commit 8e3896b

Please sign in to comment.