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

JustDecompiler small bug.

2 Answers 30 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Isidro Padilla
Top achievements
Rank 1
Isidro Padilla asked on 24 Apr 2013, 06:25 PM
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 Answers, 1 is accepted

Sort by
0
Yordan Dikov
Telerik team
answered on 25 Apr 2013, 08:46 AM
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.
0
Isidro Padilla
Top achievements
Rank 1
answered on 25 Apr 2013, 12:58 PM
I understand. Thanks for the explanation.
ipadilla
Tags
General Discussions
Asked by
Isidro Padilla
Top achievements
Rank 1
Answers by
Yordan Dikov
Telerik team
Isidro Padilla
Top achievements
Rank 1
Share this question
or