I'm looking at some disassembled .NET (C#). I don't have the original source so I'm trying to figure out some of the oddities I'm seeing.

My disassembled code has lots of things like:
bool flag = ...;
bool flag2 = ...;
bool flag3 = ...;

Similar with numbers, I see:
int num = ...;
int num2 = ...;

and logic later such as:
if ( flag2 && flag3 )

My guess is that this is the optimizer storing the results of function calls in local variables for re-use throughout the function (each flagN does seem to be used more than once). But I'm not sure. I haven't been able to reproduce this with a simple test app (either Release or Debug). Any ideas as to whether this is just "bad code" or the compiler optimizing logic?
Atzanteol
0

Add comment

Please sign in to leave a comment.