Browse Source

Fix #778: Errors about decompiling local variables and default for switch-cases

pull/892/merge
Siegfried Pammer 8 years ago
parent
commit
f3679e7df0
  1. 12
      ICSharpCode.Decompiler/IL/Transforms/DelegateConstruction.cs

12
ICSharpCode.Decompiler/IL/Transforms/DelegateConstruction.cs

@ -228,6 +228,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
public TransformDisplayClassUsages(IInstructionWithVariableOperand targetLoad, BlockContainer captureScope, List<ILInstruction> orphanedVariableInits) public TransformDisplayClassUsages(IInstructionWithVariableOperand targetLoad, BlockContainer captureScope, List<ILInstruction> orphanedVariableInits)
{ {
this.currentFunction = captureScope.Ancestors.OfType<ILFunction>().First();
this.targetLoad = targetLoad; this.targetLoad = targetLoad;
this.captureScope = captureScope; this.captureScope = captureScope;
this.orphanedVariableInits = orphanedVariableInits; this.orphanedVariableInits = orphanedVariableInits;
@ -241,17 +242,6 @@ namespace ICSharpCode.Decompiler.IL.Transforms
} }
} }
protected internal override void VisitILFunction(ILFunction function)
{
var old = currentFunction;
currentFunction = function;
try {
base.VisitILFunction(function);
} finally {
currentFunction = old;
}
}
protected internal override void VisitStLoc(StLoc inst) protected internal override void VisitStLoc(StLoc inst)
{ {
base.VisitStLoc(inst); base.VisitStLoc(inst);

Loading…
Cancel
Save