From 5a2a1119a2631767ecc82db568711d76e23e34cf Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sun, 6 Mar 2011 22:19:32 +0100 Subject: [PATCH] Decompile try-fault blocks into try-catch-rethrow. --- ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs b/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs index 4566192cb..ee184461a 100644 --- a/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs +++ b/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs @@ -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);