Problem in the decompilation of a method

2 posts, 0 answers
  1. Dominique
    Dominique avatar
    1 posts
    Member since:
    Aug 2012

    Posted 22 Jan 2012 Link to this post

    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


     

     

  2. Tsviatko Yovtchev
    Admin
    Tsviatko Yovtchev avatar
    408 posts

    Posted 27 Jan 2012 Link to this post

    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 >>

  3. DevCraft banner
Back to Top