Browse Source

Do not crash in BlockContainer.CheckInvariant

pull/998/merge
Siegfried Pammer 8 years ago
parent
commit
203311dd0b
  1. 4
      ICSharpCode.Decompiler/IL/Instructions/BlockContainer.cs

4
ICSharpCode.Decompiler/IL/Instructions/BlockContainer.cs

@ -179,8 +179,8 @@ namespace ICSharpCode.Decompiler.IL
internal override void CheckInvariant(ILPhase phase)
{
base.CheckInvariant(phase);
Debug.Assert(EntryPoint == Blocks[0]);
Debug.Assert(!IsConnected || EntryPoint.IncomingEdgeCount >= 1);
Debug.Assert(Blocks.Count > 0 && EntryPoint == Blocks[0]);
Debug.Assert(!IsConnected || EntryPoint?.IncomingEdgeCount >= 1);
Debug.Assert(Blocks.All(b => b.HasFlag(InstructionFlags.EndPointUnreachable)));
Debug.Assert(Blocks.All(b => b.Kind == BlockKind.ControlFlow)); // this also implies that the blocks don't use FinalInstruction
Block bodyStartBlock;

Loading…
Cancel
Save