I noticed that reflector does not add a checked scope when there are instructions like 'add.ovf', 'sub.ovf', etc.
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.
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
0

Comments

1 comment

  • Clive Tong
    Thanks for reporting it. I've logged it as RP-781.
    Clive Tong
    0

Add comment

Please sign in to leave a comment.