Browse Source

adjust NewObj.ResultType to work better with delegates

pull/728/head
Siegfried Pammer 11 years ago
parent
commit
6a92350795
  1. 2
      ICSharpCode.Decompiler/IL/Instructions.cs
  2. 2
      ICSharpCode.Decompiler/IL/Instructions.tt

2
ICSharpCode.Decompiler/IL/Instructions.cs

@ -2380,7 +2380,7 @@ namespace ICSharpCode.Decompiler.IL @@ -2380,7 +2380,7 @@ namespace ICSharpCode.Decompiler.IL
public NewObj(IMethod method) : base(OpCode.NewObj, method)
{
}
public override StackType ResultType { get { return StackType.O; } }
public override StackType ResultType { get { return Method.DeclaringType.GetStackType(); } }
public override void AcceptVisitor(ILVisitor visitor)
{
visitor.VisitNewObj(this);

2
ICSharpCode.Decompiler/IL/Instructions.tt

@ -174,7 +174,7 @@ @@ -174,7 +174,7 @@
new OpCode("unbox.any", "Unbox a value.",
Unary, HasTypeOperand, MemoryAccess, MayThrow, ResultType("type.GetStackType()")),
new OpCode("newobj", "Creates an object instance and calls the constructor.",
CustomClassName("NewObj"), Call, ResultType("O")),
CustomClassName("NewObj"), Call, ResultType("Method.DeclaringType.GetStackType()")),
new OpCode("newarr", "Creates an array instance.",
CustomClassName("NewArr"), HasTypeOperand, CustomArguments("size"), MayThrow, ResultType("O")),
new OpCode("initobj", "Initializes the value at an address.",

Loading…
Cancel
Save