First.
Code:
IL_0000: ldarg.1 // load a
IL_0001: ldarg.2 // load b (which is a reference)
IL_0002: ldind.i4 //dereference b (bc it is is reference: int&)
IL_0003: call BitConverter::ToUInt() //call and put result on stack
then
Code:
IL_0008: ldarg.2 // load b on stack for later use
IL_0009: ldarg.2 // load b
IL_000a: ldind.i4 //dereference it
IL_000b: ldc.i4.4 //load interger-constant "4" to stack
IL_000c: add //add the values of b and "4" and put the result on the stack
SO now the stack looks like this:
Code:
<value: result of b+4>
<reference: b> (was loaded at IL_0008)
<value: return value of the BitConverter call>
Then the last piece of the puzzle:
Code:
IL_000d: stind.i4 //store the result of "b+4" in b
There now is just one entry on the stack:
Code:
<value: return value of the BitConverter call>
and finally return that last entry:
So in conclusion the method does two things: 1) b += 4 and 2) return BitConverter(). So reflector is right and the others are wrong. You should file a bug report.
A more literal decompilation would be:
Code:
private uint e(byte[] a, ref int b)
{
uint32 tmp = BitConverter.ToUInt32(a, b);
b += 4;
return tmp;
}
But you can trivially optimize that by eliminating the tmp variable.