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
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