Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 750 Bytes

ii.19.6-fault-handlers.md

File metadata and controls

31 lines (22 loc) · 750 Bytes

II.19.6 Fault handlers

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]