BUGs - wrong output

5 posts, 0 answers
  1. Simon
    Simon avatar
    1 posts
    Member since:
    Jun 2011

    Posted 08 Jun 2011 Link to this post

    Version: Beta 2011.1.603.5

    The following code
    UiView uiView = FindFirstUiViewByType(fluentUiSpaceName, type, throwIfNotFound: false);
    is decompiled into
    UiView uiView = bool flag = false.FindFirstUiViewByType(this.fluentUiSpaceName, type, flag);

    which doesn't make much sense at all

    And also the following
    if (this.regionContainerElements[uiView.RegionName] is ItemsControl)
    is decompiled as the following bogus code
    if (this.regionContainerElements[uiView.RegionName] as ItemsControl > null)

    ..and more

    Generally, the quality of the decompiled code is nowhere near where it needs to be yet.
  2. Brian
    Brian avatar
    2 posts
    Member since:
    Jul 2010

    Posted 09 Jun 2011 Link to this post

    Here is another example of JustDecompile producing the wrong code.

    Original code:
    private static void CloseConnection(SqlConnection dbconn)
    {
        try
        {
            if (dbconn != null)
            {
                if (dbconn.State == ConnectionState.Open)
                {
                    dbconn.Close();
                    dbconn.Dispose();
                }
            }
        }
        catch (Exception ex)
        {
            if (Logger.IsErrorEnabled)
                Logger.Error("CloseConnection failed", ex);
        }
    }

    Decompiled code:
    private static void CloseConnection(SqlConnection dbconn)
    {
        try
        {
            if (dbconn == null || dbconn.State == 1)
            {
                dbconn.Close();
                dbconn.Dispose();
            }
        }
        catch (Exception ex)
        {
            if (EncryptDB.Logger.IsErrorEnabled)
            {
                EncryptDB.Logger.Error("CloseConnection failed", ex);
            }
        }
    }

    Also using Beta 2011.1.603.5
  3. DevCraft banner
  4. Tsviatko Yovtchev
    Admin
    Tsviatko Yovtchev avatar
    408 posts

    Posted 14 Jun 2011 Link to this post

    Hi Brian,

     Sorry about that and tahnks for taking the time to reprot it back to us. We still have problems and we are  working on fixing them. Is it possible that we get the MSIL code for the methods taht fail on your side? Getting the complete assembly is definitely an option, too.

    All the best,
    Tsviatko Yovtchev
    the Telerik team

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

  5. Brian
    Brian avatar
    2 posts
    Member since:
    Jul 2010

    Posted 14 Jun 2011 Link to this post

    //  Microsoft (R) .NET Framework IL Disassembler.  Version 3.5.30729.1
    //  Copyright (c) Microsoft Corporation.  All rights reserved.
      
      
    // warning : THIS IS A PARTIAL DISASSEMBLY, NOT SUITABLE FOR RE-ASSEMBLING
      
    // Only shown items having accessibility: Private
      
      
    .class private auto ansi beforefieldinit EncryptDB.EncryptDB
           extends [mscorlib]System.Object
    {
      .method private hidebysig static void  CloseConnection(class [System.Data]System.Data.SqlClient.SqlConnection dbconn) cil managed
      {
        // Code size       88 (0x58)
        .maxstack  3
        .locals init ([0] class [mscorlib]System.Exception ex,
                 [1] bool CS$4$0000)
        .language '{3F5162F8-07C6-11D3-9053-00C04FA302A1}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}'
    // Source File 'C:\VS2K8\NextGen\EncryptDB\EncryptDB.cs' 
    //000172:         {
        IL_0000:  nop
    //000173:             try
    //000174:             {
        .try
        {
          IL_0001:  nop
    //000175:                 if (dbconn != null)
          IL_0002:  ldarg.0
          IL_0003:  ldnull
          IL_0004:  ceq
          IL_0006:  stloc.1
          IL_0007:  ldloc.1
          IL_0008:  brtrue.s   IL_002c
      
    //000176:                 {
          IL_000a:  nop
    //000177:                     if (dbconn.State == ConnectionState.Open)
          IL_000b:  ldarg.0
          IL_000c:  callvirt   instance valuetype [System.Data]System.Data.ConnectionState [System.Data]System.Data.Common.DbConnection::get_State()
          IL_0011:  ldc.i4.1
          IL_0012:  ceq
          IL_0014:  ldc.i4.0
          IL_0015:  ceq
          IL_0017:  stloc.1
          IL_0018:  ldloc.1
          IL_0019:  brtrue.s   IL_002b
      
    //000178:                     {
          IL_001b:  nop
    //000179:                         dbconn.Close();
          IL_001c:  ldarg.0
          IL_001d:  callvirt   instance void [System.Data]System.Data.Common.DbConnection::Close()
          IL_0022:  nop
    //000180:                         dbconn.Dispose();
          IL_0023:  ldarg.0
          IL_0024:  callvirt   instance void [System]System.ComponentModel.Component::Dispose()
          IL_0029:  nop
    //000181:                     }
          IL_002a:  nop
    //000182:                 }
          IL_002b:  nop
    //000183:             }
          IL_002c:  nop
          IL_002d:  leave.s    IL_0056
      
    //000184:             catch (Exception ex)
        }  // end .try
        catch [mscorlib]System.Exception 
        {
          IL_002f:  stloc.0
    //000185:             {
          IL_0030:  nop
    //000186:                 if (Logger.IsErrorEnabled)
          IL_0031:  ldsfld     class [log4net]log4net.ILog EncryptDB.EncryptDB::Logger
          IL_0036:  callvirt   instance bool [log4net]log4net.ILog::get_IsErrorEnabled()
          IL_003b:  ldc.i4.0
          IL_003c:  ceq
          IL_003e:  stloc.1
          IL_003f:  ldloc.1
          IL_0040:  brtrue.s   IL_0053
      
    //000187:                     Logger.Error("CloseConnection failed", ex);
          IL_0042:  ldsfld     class [log4net]log4net.ILog EncryptDB.EncryptDB::Logger
          IL_0047:  ldstr      "CloseConnection failed"
          IL_004c:  ldloc.0
          IL_004d:  callvirt   instance void [log4net]log4net.ILog::Error(object,
                                                                          class [mscorlib]System.Exception)
          IL_0052:  nop
    //000188:             }
          IL_0053:  nop
          IL_0054:  leave.s    IL_0056
      
        }  // end handler
        IL_0056:  nop
    //000189:         }
        IL_0057:  ret
      } // end of method EncryptDB::CloseConnection
      
    } // end of class EncryptDB.EncryptDB
      
    // *********** DISASSEMBLY COMPLETE ***********************
    // WARNING: Created Win32 resource file CloseConnection.res
  6. Tsviatko Yovtchev
    Admin
    Tsviatko Yovtchev avatar
    408 posts

    Posted 20 Jun 2011 Link to this post

    Thanks a bunch for getting back to me Brian. We'll definitely fix taht now taht we have all the information.

    Best wishes,
    Tsviatko Yovtchev
    the Telerik team

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

Back to Top
DevCraft banner