Browse Source

Fix #1900: RemoveDeadVariableInit.ResetHasInitialValueFlag should handle local functions

pull/1968/head
Siegfried Pammer 5 years ago
parent
commit
5ee172d4c4
  1. 3
      ICSharpCode.Decompiler/IL/Transforms/TransformDisplayClassUsage.cs

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

@ -84,7 +84,8 @@ namespace ICSharpCode.Decompiler.IL.Transforms
containingBlock.Instructions.Remove(store); containingBlock.Instructions.Remove(store);
} }
} }
RemoveDeadVariableInit.ResetHasInitialValueFlag(function, context); foreach (var f in TreeTraversal.PostOrder(function, f => f.LocalFunctions))
RemoveDeadVariableInit.ResetHasInitialValueFlag(f, context);
} finally { } finally {
instructionsToRemove.Clear(); instructionsToRemove.Clear();
displayClasses.Clear(); displayClasses.Clear();

Loading…
Cancel
Save