Why is the try catch attempt turned on again inside the try block.
Not sure about that. It may be that ildasm decides to decompile it. ECMA-335 says that there are restrictions on how SEHClause elements can be specified after TryBlock , but I have not found these restrictions yet.
It seems that left.s last line in the try and catch block finally indicates that IL_0010, but in line IL_0010 its ldloc.1, which, I believe, means loading local variable 1 on the stack, while pointing to final block, This is something like in location 1, we have the address of the finally block.
No, that jumps after the finally block - to effectively return the value. This does not help that you have many return statements returning the same thing, as well as unreachable code, but I believe that in principle, just moving ret outside of try and catch . I think the compiler efficiently sets up an additional local variable for the return value.
If I drop or return something from the catch block, then how it turns out that the call statement falls to the finally block, it already returns from the catch block, but still the finally block is executed.
Both C # and IL are defined - the finally block will be executed, but you exit the block.
Jon skeet
source share