@@ -23,12 +23,12 @@ public static class CecilSymbolHelper
2323 public static List < BranchPoint > GetBranchPoints ( MethodDefinition methodDefinition )
2424 {
2525 var list = new List < BranchPoint > ( ) ;
26- if ( methodDefinition == null )
26+ if ( methodDefinition == null )
2727 return list ;
2828
2929 UInt32 ordinal = 0 ;
3030 var instructions = methodDefinition . Body . Instructions ;
31-
31+
3232 // if method is a generated MoveNext skip first branch (could be a switch or a branch)
3333 var skipFirstBranch = IsMovenext . IsMatch ( methodDefinition . FullName ) ;
3434
@@ -45,7 +45,7 @@ public static List<BranchPoint> GetBranchPoints(MethodDefinition methodDefinitio
4545 if ( BranchIsInGeneratedExceptionFilter ( instruction , methodDefinition ) )
4646 continue ;
4747
48- if ( BranchIsInGeneratedFinallyBlock ( instruction , methodDefinition ) )
48+ if ( BranchIsInGeneratedFinallyBlock ( instruction , methodDefinition ) )
4949 continue ;
5050
5151 var pathCounter = 0 ;
@@ -59,7 +59,7 @@ public static List<BranchPoint> GetBranchPoints(MethodDefinition methodDefinitio
5959 if ( instruction . Next == null )
6060 return list ;
6161
62- if ( ! BuildPointsForConditionalBranch ( list , instruction , branchingInstructionLine , document , branchOffset , pathCounter , instructions , ref ordinal , methodDefinition ) )
62+ if ( ! BuildPointsForConditionalBranch ( list , instruction , branchingInstructionLine , document , branchOffset , pathCounter , instructions , ref ordinal , methodDefinition ) )
6363 return list ;
6464 }
6565 catch ( Exception )
@@ -71,7 +71,7 @@ public static List<BranchPoint> GetBranchPoints(MethodDefinition methodDefinitio
7171 }
7272
7373 private static bool BuildPointsForConditionalBranch ( List < BranchPoint > list , Instruction instruction ,
74- int branchingInstructionLine , string document , int branchOffset , int pathCounter ,
74+ int branchingInstructionLine , string document , int branchOffset , int pathCounter ,
7575 Collection < Instruction > instructions , ref uint ordinal , MethodDefinition methodDefinition )
7676 {
7777 // Add Default branch (Path=0)
@@ -215,12 +215,12 @@ private static bool BranchIsInGeneratedExceptionFilter(Instruction branchInstruc
215215 Instruction startFilter = exceptionHandler . FilterStart ;
216216 Instruction endFilter = startFilter ;
217217
218- while ( endFilter . OpCode != OpCodes . Endfilter && endFilter != null )
218+ while ( endFilter . OpCode != OpCodes . Endfilter && endFilter != null )
219219 {
220220 endFilter = endFilter . Next ;
221221 }
222222
223- if ( branchInstruction . Offset >= startFilter . Offset && branchInstruction . Offset <= endFilter . Offset )
223+ if ( branchInstruction . Offset >= startFilter . Offset && branchInstruction . Offset <= endFilter . Offset )
224224 {
225225 return true ;
226226 }
@@ -231,17 +231,17 @@ private static bool BranchIsInGeneratedExceptionFilter(Instruction branchInstruc
231231
232232 private static bool BranchIsInGeneratedFinallyBlock ( Instruction branchInstruction , MethodDefinition methodDefinition )
233233 {
234- if ( ! methodDefinition . Body . HasExceptionHandlers )
234+ if ( ! methodDefinition . Body . HasExceptionHandlers )
235235 return false ;
236-
236+
237237 // a generated finally block will have no sequence points in its range
238238 var handlers = methodDefinition . Body . ExceptionHandlers
239239 . Where ( e => e . HandlerType == ExceptionHandlerType . Finally )
240240 . ToList ( ) ;
241241
242242 return handlers
243243 . Where ( e => branchInstruction . Offset >= e . HandlerStart . Offset )
244- . Where ( e => branchInstruction . Offset < e . HandlerEnd . Maybe ( h => h . Offset , GetOffsetOfNextEndfinally ( methodDefinition . Body , e . HandlerStart . Offset ) ) )
244+ . Where ( e => branchInstruction . Offset < e . HandlerEnd . Maybe ( h => h . Offset , GetOffsetOfNextEndfinally ( methodDefinition . Body , e . HandlerStart . Offset ) ) )
245245 . OrderByDescending ( h => h . HandlerStart . Offset ) // we need to work inside out
246246 . Any ( eh => ! ( methodDefinition . DebugInformation . GetSequencePointMapping ( )
247247 . Where ( i => i . Value . StartLine != StepOverLineCode )
@@ -262,7 +262,7 @@ private static List<int> GetBranchPath(Instruction instruction)
262262 {
263263 var point = instruction ;
264264 offsetList . Add ( point . Offset ) ;
265- while ( point . OpCode == OpCodes . Br || point . OpCode == OpCodes . Br_S )
265+ while ( point . OpCode == OpCodes . Br || point . OpCode == OpCodes . Br_S )
266266 {
267267 var nextPoint = point . Operand as Instruction ;
268268 if ( nextPoint != null )
@@ -283,7 +283,7 @@ private static List<int> GetBranchPath(Instruction instruction)
283283 private static Instruction FindClosestInstructionWithSequencePoint ( MethodBody methodBody , Instruction instruction )
284284 {
285285 var sequencePointsInMethod = methodBody . Instructions . Where ( i => HasValidSequencePoint ( i , methodBody . Method ) ) . ToList ( ) ;
286- if ( ! sequencePointsInMethod . Any ( ) )
286+ if ( ! sequencePointsInMethod . Any ( ) )
287287 return null ;
288288 var idx = sequencePointsInMethod . BinarySearch ( instruction , new InstructionByOffsetComparer ( ) ) ;
289289 Instruction prev ;
0 commit comments