From a602138b0ecc26bc453f4c2c63d3e72175d96cd2 Mon Sep 17 00:00:00 2001 From: Eusebiu Marcu Date: Tue, 1 Mar 2011 17:27:50 +0200 Subject: [PATCH] fix ILRange ToArray. --- ICSharpCode.Decompiler/CodeMappings.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ICSharpCode.Decompiler/CodeMappings.cs b/ICSharpCode.Decompiler/CodeMappings.cs index 1efb6387b..d420248f1 100644 --- a/ICSharpCode.Decompiler/CodeMappings.cs +++ b/ICSharpCode.Decompiler/CodeMappings.cs @@ -31,7 +31,7 @@ namespace ICSharpCode.Decompiler { int[] result = new int[2]; result[0] = ILInstructionOffset.From; - result[1] = ILInstructionOffset.To + 1; + result[1] = ILInstructionOffset.From + 1 == ILInstructionOffset.To ? ILInstructionOffset.To : ILInstructionOffset.To + 1; return result; } @@ -171,8 +171,7 @@ namespace ICSharpCode.Decompiler continue; var codeMapping = mapping.MethodCodeMappings.Find( - cm => (cm.ILInstructionOffset.From <= ilOffset && ilOffset <= cm.ILInstructionOffset.To - 1) || // for CSharp - (cm.ILInstructionOffset.From == ilOffset && ilOffset == cm.ILInstructionOffset.To)); // for IL + cm => cm.ILInstructionOffset.From <= ilOffset && ilOffset <= cm.ILInstructionOffset.To - 1); if (codeMapping == null) { codeMapping = mapping.MethodCodeMappings.Find(cm => (cm.ILInstructionOffset.From >= ilOffset)); if (codeMapping == null) {