Browse Source

#1349: Fix exception in HandleDelegateConstruction, if the target of NewObj is not a delegate.

pull/1633/head
Siegfried Pammer 6 years ago
parent
commit
6526363cb3
  1. 2
      ICSharpCode.Decompiler/CSharp/CallBuilder.cs

2
ICSharpCode.Decompiler/CSharp/CallBuilder.cs

@ -142,7 +142,7 @@ namespace ICSharpCode.Decompiler.CSharp
public TranslatedExpression Build(CallInstruction inst) public TranslatedExpression Build(CallInstruction inst)
{ {
if (inst is NewObj newobj && IL.Transforms.DelegateConstruction.IsDelegateConstruction(newobj, true)) { if (inst is NewObj newobj && IL.Transforms.DelegateConstruction.IsDelegateConstruction(newobj)) {
return HandleDelegateConstruction(newobj); return HandleDelegateConstruction(newobj);
} }
if (settings.TupleTypes && TupleTransform.MatchTupleConstruction(inst as NewObj, out var tupleElements) && tupleElements.Length >= 2) { if (settings.TupleTypes && TupleTransform.MatchTupleConstruction(inst as NewObj, out var tupleElements) && tupleElements.Length >= 2) {

Loading…
Cancel
Save