Browse Source

Fix #2557: Remove incorrect assertion from `ReduceNestingTransform`

ILFunctions can appear as statements when the source code has a lambda expression which is immediately discarded.

```
_ = (Action)delegate { ... };
```
pull/2560/head
Daniel Grunwald 4 years ago
parent
commit
17d323c943
  1. 2
      ICSharpCode.Decompiler/IL/Transforms/ReduceNestingTransform.cs

2
ICSharpCode.Decompiler/IL/Transforms/ReduceNestingTransform.cs

@ -552,8 +552,6 @@ namespace ICSharpCode.Decompiler.IL @@ -552,8 +552,6 @@ namespace ICSharpCode.Decompiler.IL
ComputeStats(caseBlock, ref numStatements, ref maxDepth, currentDepth);
break;
case ILFunction func:
Debug.Assert(!isStatement);
int bodyStatements = 0;
int bodyMaxDepth = maxDepth;
ComputeStats(func.Body, ref bodyStatements, ref bodyMaxDepth, currentDepth);

Loading…
Cancel
Save