From 46ba4fc66af2040bbdad6b2d4aa6e4bbb2d5edc4 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Thu, 11 Apr 2019 11:34:25 +0200 Subject: [PATCH] Fix #1480: InvalidOperationException in PortablePdbWriter. --- ICSharpCode.Decompiler/DebugInfo/PortablePdbWriter.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ICSharpCode.Decompiler/DebugInfo/PortablePdbWriter.cs b/ICSharpCode.Decompiler/DebugInfo/PortablePdbWriter.cs index 2ce50e8cd..4aee9bcb3 100644 --- a/ICSharpCode.Decompiler/DebugInfo/PortablePdbWriter.cs +++ b/ICSharpCode.Decompiler/DebugInfo/PortablePdbWriter.cs @@ -135,15 +135,15 @@ namespace ICSharpCode.Decompiler.DebugInfo } } - stateMachineMethods.SortBy(row => row.MoveNextMethod); + stateMachineMethods.SortBy(row => MetadataTokens.GetRowNumber(row.MoveNextMethod)); foreach (var row in stateMachineMethods) { metadata.AddStateMachineMethod(row.MoveNextMethod, row.KickoffMethod); } - customMethodDebugInfo.SortBy(row => row.Parent); + customMethodDebugInfo.SortBy(row => MetadataTokens.GetRowNumber(row.Parent)); foreach (var row in customMethodDebugInfo) { metadata.AddCustomDebugInformation(row.Parent, row.Guid, row.Blob); } - customDocumentDebugInfo.SortBy(row => row.Parent); + customDocumentDebugInfo.SortBy(row => MetadataTokens.GetRowNumber(row.Parent)); foreach (var row in customDocumentDebugInfo) { metadata.AddCustomDebugInformation(row.Parent, row.Guid, row.Blob); }