|
|
|
|
@ -224,10 +224,13 @@ namespace ICSharpCode.Decompiler.ILAst
@@ -224,10 +224,13 @@ namespace ICSharpCode.Decompiler.ILAst
|
|
|
|
|
// Virtual instructions to load exception on stack
|
|
|
|
|
Dictionary<ExceptionHandler, ByteCode> ldexceptions = new Dictionary<ExceptionHandler, ILAstBuilder.ByteCode>(); |
|
|
|
|
|
|
|
|
|
public List<ILNode> Build(MethodDefinition methodDef, bool optimize) |
|
|
|
|
DecompilerContext context; |
|
|
|
|
|
|
|
|
|
public List<ILNode> Build(MethodDefinition methodDef, bool optimize, DecompilerContext context) |
|
|
|
|
{ |
|
|
|
|
this.methodDef = methodDef; |
|
|
|
|
this.optimize = optimize; |
|
|
|
|
this.context = context; |
|
|
|
|
|
|
|
|
|
if (methodDef.Body.Instructions.Count == 0) return new List<ILNode>(); |
|
|
|
|
|
|
|
|
|
@ -711,7 +714,10 @@ namespace ICSharpCode.Decompiler.ILAst
@@ -711,7 +714,10 @@ namespace ICSharpCode.Decompiler.ILAst
|
|
|
|
|
first.Arguments[0].Operand == ldexception.StoreTo[0]) |
|
|
|
|
{ |
|
|
|
|
// The exception is just poped - optimize it all away;
|
|
|
|
|
catchBlock.ExceptionVariable = null; |
|
|
|
|
if (context.Settings.AlwaysGenerateExceptionVariableForCatchBlocks) |
|
|
|
|
catchBlock.ExceptionVariable = new ILVariable() { Name = "ex_" + eh.HandlerStart.Offset.ToString("X2"), IsGenerated = true }; |
|
|
|
|
else |
|
|
|
|
catchBlock.ExceptionVariable = null; |
|
|
|
|
catchBlock.Body.RemoveAt(0); |
|
|
|
|
} else { |
|
|
|
|
catchBlock.ExceptionVariable = ldexception.StoreTo[0]; |
|
|
|
|
|