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

If missing when decompiling

1 Answer 44 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
jp
Top achievements
Rank 1
jp asked on 02 Dec 2011, 04:02 PM
Hi, 

Here is one example of a missing condition when decompiling.

As you can see, there is an IF missing...

Original code
Sub Main()
 
    Dim arr1(-1) As String
    Dim arr2(-1) As String
 
    Dim bTest1 As Boolean = arr1.Any()
    Dim bTest2 As Boolean = arr2.Any()
 
    If Not bTest1 OrElse Not bTest2 Then
 
        Console.WriteLine("test0")
 
        If Not bTest1 Then
 
            Console.WriteLine("test1")
 
        End If
 
        If Not bTest2 Then
 
            Console.WriteLine("test2")
 
        End If
 
    End If
 
    Console.ReadKey()
 
 
End Sub

The result :

public static void Main()
{
    string[] arr1 = new string[0];
    string[] arr2 = new string[0];
    bool bTest1 = arr1.Any<string>();
    bool bTest2 = arr2.Any<string>();
    bool flag = !bTest1 || !bTest2;
    Console.WriteLine("test0");
    flag = bTest1 == 0;
    if (flag)
    {
        Console.WriteLine("test1");
    }
    flag = bTest2 == 0;
    if (flag)
    {
        Console.WriteLine("test2");
    }
    Console.ReadKey();
}

Thanks

1 Answer, 1 is accepted

Sort by
0
Yordan Dikov
Telerik team
answered on 07 Dec 2011, 01:12 PM
Hi Jp,

 Thank you for the example. We're aware that we have problems in cases like this and we're currently working hard on handling them better. We'll definitely take into account your example when testing our solution.

Regards,
Yordan Dikov
the Telerik team

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

Tags
General Discussions
Asked by
jp
Top achievements
Rank 1
Answers by
Yordan Dikov
Telerik team
Share this question
or