diff options
author | Jb Evain <jb@evain.net> | 2017-09-08 20:58:17 +0300 |
---|---|---|
committer | Jb Evain <jb@evain.net> | 2017-09-08 20:58:17 +0300 |
commit | 3bd25b7bb42066ec50bf3d7350456252a893e561 (patch) | |
tree | 27e13fd9776b1edc87aaeeda341a7c6c623be9bf /Mono.Cecil.Cil | |
parent | c4c6dff87f98df0428a5b8419778966037211642 (diff) |
Avoid exception in GetSequencePointMapping when a pdb has multiple sequence points for the same offset. Fix #425
Diffstat (limited to 'Mono.Cecil.Cil')
-rw-r--r-- | Mono.Cecil.Cil/Symbols.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Mono.Cecil.Cil/Symbols.cs b/Mono.Cecil.Cil/Symbols.cs index 6ef5ad2..85c5334 100644 --- a/Mono.Cecil.Cil/Symbols.cs +++ b/Mono.Cecil.Cil/Symbols.cs @@ -671,8 +671,10 @@ namespace Mono.Cecil.Cil { var offset_mapping = new Dictionary<int, SequencePoint> (sequence_points.Count); - for (int i = 0; i < sequence_points.Count; i++) - offset_mapping.Add (sequence_points [i].Offset, sequence_points [i]); + for (int i = 0; i < sequence_points.Count; i++) { + if (!offset_mapping.ContainsKey (sequence_points [i].Offset)) + offset_mapping.Add (sequence_points [i].Offset, sequence_points [i]); + } var instructions = method.Body.Instructions; |