Comments
5 comments
-
It looks like an optimization, but I am not sure.
I suppose the DLL you fed Reflector with was a Release one, maybe a 64bits? -
Thanks for the reply Olivier. I'm sure you're right - that it's optimisation. The thing is, I could have sworn that it was a debug build, 32bit. I'm not sure if debug builds still perform optimizations, I wouldn't have thought so, given the necessity to match line for line with the source when debugging, but I guess maybe the PDB sorts that out...
-
Now, I'm not so sure I was right:
I've tried similar code, in debug and release mode... same result in Reflector, and no CS$ stuff...
And, unless you modify your project's Build properties, debug mode comes with no optimizations. -
Hmmm, it's strange isn't it? It was compiled on my machine, copied to a bin directory on a server (64bit) and then copied back to my machine to be decompiled.
Oh well, if you happen to have any thoughts sometime about what might have caused it, it would be great to hear them -
When it seems the Reflector is returning something unexpected in the decompiled languages (C#, VB, etc) change it to IL and see what it looks like. The IL is a straight disassembled representation of the exe/dll so if the IL code looks odd then the strangeness is in your compiler ... not the decompiler. Sometimes its hard to track down which one did or didn't do an optimization.
Depending on the complexity of your assembly, you might try roundtripping the exe in ILDasm and strip out the debug info ... the debug builds can add alot of code to enable a user to put break points on every line of source code ... and even more in 2.0 + due to multiple statements in one line of source code.
Add comment
Please sign in to leave a comment.
e.g. Original code:
Decompiles to:
It's doubtless functionally equivalent but is this to be expected? It's a bummer when trying to use diff to find the new code.
Any thoughts? Thanks