The ExceptionHandlingClauses
property is providing information about the exception handling clauses in the compiled bytecode. The semantics of exception handling blocks in the bytecode is governed by the ECMA-335 standard, not by ECMA-334 (the C# language standard). The rules for exception handling blocks in C# differ from those imposed by the bytecode, so the compiler sometimes compiles the code in a way that produces what seem to be strange exception handling blocks but in fact result the proper runtime semantics according to the original C# code.
In other cases, C# provides "syntactic sugar" for features not supported by bytecode primitives. For example, the using
and lock
statements in C# are both implemented by compiling down to try
/finally
blocks, which will be included in the ExceptionHandlingClauses
property.