A finally block is declared using the finally keyword. This specifies the handler code, with this grammar:
SEHClause ::= … |
---|
| finally HandlerBlock |
The last possible CIL instruction that can be executed in a finally handler shall be endfinally
.
[Example:
.try {
… // protected instructions
leave exitTry // shall use leave
}
finally {
… // finally handler
endfinally
}
exitTry: // back to normal
end example]