A fault block is declared using the fault keyword. This specifies the handler code, with this grammar:
SEHClause ::= … |
---|
| fault HandlerBlock |
The last possible CIL instruction that can be executed in a fault handler shall be endfault
.
[Example:
.method public static void m() {
startTry:
… // protected instructions
leave exitSEH // shall use leave
endTry:
startFault:
… // fault handler instructions
endfault
endFault:
.try startTry to endTry // fault handler startFault to endFault
exitSEH: // back to normal
}
end example]