Comments
Sort by recent activity
The project type is a console application and is compiled with .NET Core 1.0. However I can also repro this issue with a .NET Framework 4 WinForms app. Changing the C# version at the top of Reflector also seems to have no effect. For reference here is the IL which may explain the problem: .method private hidebysig static void ABC(uint8[] b) cil managed
{
.maxstack 2
.locals init (
[0] bool flag)
L_0000: nop
L_0001: ldarg.0
L_0002: ldnull
L_0003: cgt.un // -- here?
L_0005: stloc.0
L_0006: ldloc.0
L_0007: brfalse.s L_0012
L_0009: nop
L_000a: ldc.i4.0
L_000b: call void [mscorlib]System.Environment::Exit(int32)
L_0010: nop
L_0011: nop
L_0012: ret
}
https://stackoverflow.com/questions/28781839/why-does-the-c-sharp-compiler-translate-this-comparison-as-if-it-were-a-com / comments
The project type is a console application and is compiled with .NET Core 1.0. However I can also repro this issue with a .NET Framework 4 WinForms app. Changing the C# version at the top of Reflect...
@CreateAndInject The IL is in the static constructor (.cctor method). That is where the static variables are initialised. / comments
@CreateAndInject The IL is in the static constructor (.cctor method). That is where the static variables are initialised.