Browse Source

make sure that we add only good ranges

pull/191/merge
Eusebiu Marcu 15 years ago
parent
commit
ec45106303
  1. 7
      ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs

7
ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs

@ -137,6 +137,13 @@ namespace ICSharpCode.Decompiler.Ast @@ -137,6 +137,13 @@ namespace ICSharpCode.Decompiler.Ast
// make sure we have one ILRange per source code line
var map = mapping.MemberCodeMappings.Find(s => s.SourceCodeLine == output.CurrentLine);
if (map == null) {
// check if the range is in previous mapping
var prevmap = mapping.MemberCodeMappings.Find(m => m.ILInstructionOffset.From <= range.From &&
m.ILInstructionOffset.To >= range.To);
if (prevmap != null)
continue;
mapping.MemberCodeMappings.Add(new SourceCodeMapping {
ILInstructionOffset = range,
SourceCodeLine = output.CurrentLine,

Loading…
Cancel
Save