Browse Source

#1913: Do not destroy control-flow by removing return statements

pull/1941/head
Siegfried Pammer 6 years ago
parent
commit
bef75321fb
  1. 3
      ICSharpCode.Decompiler/IL/Transforms/TransformDisplayClassUsage.cs

3
ICSharpCode.Decompiler/IL/Transforms/TransformDisplayClassUsage.cs

@ -64,7 +64,8 @@ namespace ICSharpCode.Decompiler.IL.Transforms
if ((context.Settings.AnonymousMethods || context.Settings.ExpressionTrees) && IsClosure(context, v, out ITypeDefinition closureType, out var inst)) {
if (!CanRemoveAllReferencesTo(context, v))
continue;
instructionsToRemove.Add(inst);
if (inst is StObj || inst is StLoc)
instructionsToRemove.Add(inst);
AddOrUpdateDisplayClass(f, v, closureType, inst, localFunctionClosureParameter: false);
continue;
}

Loading…
Cancel
Save