Browse Source

Fix #1332: DecompileMemberBodies: Cannot mutate frozen NullBlockStatement

pull/1347/head
Siegfried Pammer 7 years ago
parent
commit
86329349ba
  1. 2
      ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs

2
ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs

@ -1174,7 +1174,7 @@ namespace ICSharpCode.Decompiler.CSharp @@ -1174,7 +1174,7 @@ namespace ICSharpCode.Decompiler.CSharp
entityDecl.AddAnnotation(function);
if (function.IsIterator) {
if (!body.Descendants.Any(d => d is YieldReturnStatement || d is YieldBreakStatement)) {
if (localSettings.DecompileMemberBodies && !body.Descendants.Any(d => d is YieldReturnStatement || d is YieldBreakStatement)) {
body.Add(new YieldBreakStatement());
}
RemoveAttribute(entityDecl, KnownAttribute.IteratorStateMachine);

Loading…
Cancel
Save