Browse Source

Decompile try-fault blocks into try-catch-rethrow.

pull/70/head
Daniel Grunwald 15 years ago
parent
commit
5a2a1119a2
  1. 6
      ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs

6
ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs

@ -147,6 +147,12 @@ namespace ICSharpCode.Decompiler.Ast @@ -147,6 +147,12 @@ namespace ICSharpCode.Decompiler.Ast
}
if (tryCatchNode.FinallyBlock != null)
tryCatchStmt.FinallyBlock = TransformBlock(tryCatchNode.FinallyBlock);
if (tryCatchNode.FaultBlock != null) {
CatchClause cc = new CatchClause();
cc.Body = TransformBlock(tryCatchNode.FaultBlock);
cc.Body.Add(new ThrowStatement()); // rethrow
tryCatchStmt.CatchClauses.Add(cc);
}
yield return tryCatchStmt;
} else if (node is ILBlock) {
yield return TransformBlock((ILBlock)node);

Loading…
Cancel
Save