|
|
@ -163,9 +163,14 @@ namespace ICSharpCode.Decompiler.CSharp |
|
|
|
tryCatch.TryBlock = ConvertAsBlock(inst.TryBlock); |
|
|
|
tryCatch.TryBlock = ConvertAsBlock(inst.TryBlock); |
|
|
|
foreach (var handler in inst.Handlers) { |
|
|
|
foreach (var handler in inst.Handlers) { |
|
|
|
var catchClause = new CatchClause(); |
|
|
|
var catchClause = new CatchClause(); |
|
|
|
if (handler.Variable != null) { |
|
|
|
var v = handler.Variable; |
|
|
|
catchClause.Type = exprBuilder.ConvertType(handler.Variable.Type); |
|
|
|
if (v != null) { |
|
|
|
catchClause.VariableName = handler.Variable.Name; |
|
|
|
if (v.StoreCount > 1 || v.LoadCount > 0 || v.AddressCount > 0) { |
|
|
|
|
|
|
|
catchClause.VariableName = v.Name; |
|
|
|
|
|
|
|
catchClause.Type = exprBuilder.ConvertType(v.Type); |
|
|
|
|
|
|
|
} else if (!v.Type.IsKnownType(KnownTypeCode.Object)) { |
|
|
|
|
|
|
|
catchClause.Type = exprBuilder.ConvertType(v.Type); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (!handler.Filter.MatchLdcI4(1)) |
|
|
|
if (!handler.Filter.MatchLdcI4(1)) |
|
|
|
catchClause.Condition = exprBuilder.TranslateCondition(handler.Filter); |
|
|
|
catchClause.Condition = exprBuilder.TranslateCondition(handler.Filter); |
|
|
|