JustDecompiler small bug.

3 posts, 0 answers
  1. Isidro Padilla
    Isidro Padilla avatar
    31 posts
    Member since:
    Sep 2012

    Posted 24 Apr 2013 Link to this post

    Hello Justdecompiler Team,
    Can you fix this small bug in future releases?
    Every day I like more and more Justdecompiler. Good decompiler!
    Thanks for sharing.
    ipadilla

    Generated code:
            private static byte[] ReadFile(string file)
            {
                FileStream fileStream = null;
                byte[] numArray = null;
                try
                {
                    fileStream = File.OpenRead(file);
                    numArray = new byte[checked((IntPtr)fileStream.Length)];
                    fileStream.Read(numArray, 0, (int)numArray.Length);
                    fileStream.Flush();
                }
                finally
                {
                    if (fileStream != null)
                    {
                        fileStream.Close();
                    }
                    fileStream = null;
                }
                return numArray;
            }

    It have to be:

            private static byte[] ReadFile(string file)
            {
                FileStream fileStream = null;
                byte[] numArray = null;
                try
                {
                    fileStream = File.OpenRead(file);
                    //numArray = new byte[checked((IntPtr)fileStream.Length)];
                    numArray = new byte[fileStream.Length];
                    fileStream.Read(numArray, 0, (int)numArray.Length);
                    fileStream.Flush();
                }
                finally
                {
                    if (fileStream != null)
                    {
                        fileStream.Close();
                    }
                    fileStream = null;
                }
                return numArray;
            }
  2. Yordan Dikov
    Admin
    Yordan Dikov avatar
    69 posts

    Posted 25 Apr 2013 Link to this post

    Hello Isidro,

     Thank you for the warm words. We've seen code similar to the one you pointed out, so we're aware of the issue. However, it's rather rare occurrence and the fact that the fix in the general case isn't as straight-forward have put it behind on our list. However, we'll have a look at it at some point, so stay tuned for updates.

    Kind regards,
    Yordan Dikov
    the Telerik team
    Tell us what you think about JustDecompile. Your opinion matters! You can use our forum, or our JustDecompile UserVoice website for feature requests.
  3. DevCraft banner
  4. Isidro Padilla
    Isidro Padilla avatar
    31 posts
    Member since:
    Sep 2012

    Posted 25 Apr 2013 Link to this post

    I understand. Thanks for the explanation.
    ipadilla
Back to Top