Support for C# 'Checked'.

Explore, browse and analyze .NET assemblies

Moderators: Luke Jefferson, Charles Brown, StephenC, Alex.Davies, Greg.Tillman, melvyn.harbour

Support for C# 'Checked'.

Postby high6 » Mon Dec 06, 2010 6:33 am

I noticed that reflector does not add a checked scope when there are instructions like 'add.ovf', 'sub.ovf', etc.

Code: Select all
void A()
        {
            int a = 5;
            int b = 7;
            int c = a + b;
        }
        void B()
        {
            int a = 5;
            int b = 7;
            checked
            {
                int c = a + b;
            }
        }
        void D()
        {
            uint a = 5;
            uint b = 7;
            checked
            {
                uint c = a + b;
            }
        }


Compiled that and reflector shows.

Code: Select all
    private void A()
    {
        int a = 5;
        int b = 7;
        int c = a + b;
    }
    private void B()
    {
        int a = 5;
        int b = 7;
        int c = a + b;
    }
    private void D()
    {
        uint a = 5;
        uint b = 7;
        uint c = a + b;
    }


Even though B and D use add.ovf and add.ovf.un
high6
 
Posts: 9
Joined: Fri Sep 19, 2008 8:15 pm

Postby Clive Tong » Mon Dec 06, 2010 9:15 am

Thanks for reporting it. I've logged it as RP-781.
Clive Tong
 
Posts: 283
Joined: Thu Dec 04, 2008 5:42 pm


Return to .Net Reflector 6.x and .NET Reflector 6.x Pro

Who is online

Users browsing this forum: No registered users and 0 guests