Browse Source

Fix #1912: NRE in CSharpILMixedLanguage.MixedMethodBodyDisassembler.Disassemble()

pull/1914/head
Siegfried Pammer 6 years ago
parent
commit
6eb9790a00
  1. 2
      ILSpy/Languages/CSharpILMixedLanguage.cs

2
ILSpy/Languages/CSharpILMixedLanguage.cs

@ -91,7 +91,7 @@ namespace ICSharpCode.ILSpy @@ -91,7 +91,7 @@ namespace ICSharpCode.ILSpy
CSharpDecompiler decompiler = CreateDecompiler(module, options);
var st = decompiler.Decompile(handle);
WriteCode(csharpOutput, options.DecompilerSettings, st, decompiler.TypeSystem);
var mapping = decompiler.CreateSequencePoints(st).FirstOrDefault(kvp => (kvp.Key.MoveNextMethod ?? kvp.Key.Method).MetadataToken == handle);
var mapping = decompiler.CreateSequencePoints(st).FirstOrDefault(kvp => (kvp.Key.MoveNextMethod ?? kvp.Key.Method)?.MetadataToken == handle);
this.sequencePoints = mapping.Value ?? (IList<SequencePoint>)EmptyList<SequencePoint>.Instance;
this.codeLines = csharpOutput.ToString().Split(new[] { Environment.NewLine }, StringSplitOptions.None);
base.Disassemble(module, handle);

Loading…
Cancel
Save