This is a migrated thread and some comments may be shown as answers.

Problem in the decompilation of a method

1 Answer 18 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dominique
Top achievements
Rank 1
Dominique asked on 22 Jan 2012, 10:28 PM
Source code in C#:
internal class MemoryStreamWithPosition : MemoryStream

{

  public int Position_Read { get; set; }

  public int Position_Write { get; set; }

  public object synch = new object();

  public void InitOrReinit()

  {

    Position_Write = Position_Read = 0;

    Position = 0;

    SetLength(0);

  }

}
Translation:

internal class MemoryStreamWithPosition : MemoryStream
{
    public object synch;

    public int Position_Read
    {
        get;
        set;
    }

    public int Position_Write
    {
        get;
        set;
    }

    public MemoryStreamWithPosition()
    {
        this.synch = new object();
    }

    public void InitOrReinit()
    {
        0.set_Position_Read(int num = 0).Position_Write = num;
        base.Position = (long)0;
        base.SetLength((long)0);
    }
}
The IL code is good.

    .method public hidebysig
        instance void InitOrReinit () cil managed
    {
        .locals init (
            [0] int32 num
        )

        IL_0000: ldarg.0
        IL_0001: ldarg.0
        IL_0002: ldc.i4.0
        IL_0003: dup
        IL_0004: stloc.0
        IL_0005: call instance void httpToNegotiateStream.MemoryStreamWithPosition::set_Position_Read(int32)
        IL_000a: ldloc.0
        IL_000b: call instance void httpToNegotiateStream.MemoryStreamWithPosition::set_Position_Write(int32)
        IL_0010: ldarg.0
        IL_0011: ldc.i4.0
        IL_0012: conv.i8
        IL_0013: callvirt instance void [mscorlib]System.IO.Stream::set_Position(int64)
        IL_0018: ldarg.0
        IL_0019: ldc.i4.0
        IL_001a: conv.i8
        IL_001b: callvirt instance void [mscorlib]System.IO.Stream::SetLength(int64)
        IL_0020: ret
    }

I give you this information as feedback.
Thanks for the product.

Dominique


 

 

1 Answer, 1 is accepted

Sort by
0
Tsviatko Yovtchev
Telerik team
answered on 27 Jan 2012, 12:59 PM
Hi Dominique,

 Fortunately we are aware of this problem and we are already working on fixing it. So, please, stay tuned and update regularly.

Do not hesitate to contact us should another problem arise.

Regards,
Tsviatko Yovtchev
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
General Discussions
Asked by
Dominique
Top achievements
Rank 1
Answers by
Tsviatko Yovtchev
Telerik team
Share this question
or