Skip to content

Latest commit

 

History

History
27 lines (15 loc) · 850 Bytes

iii.4.31-throw.md

File metadata and controls

27 lines (15 loc) · 850 Bytes

III.4.31 throw – throw an exception

Format Assembly Format Description
7A throw Throw an exception.

Stack Transition:

…, object → …,

Description:

The throw instruction throws the exception object (type O) on the stack and empties the stack. For details of the exception mechanism, see Partition I.

[Note: While the CLI permits any object to be thrown, the CLS describes a specific exception class that shall be used for language interoperability. end note]

Exceptions:

System.NullReferenceException is thrown if obj is null.

Correctness:

Correct CIL ensures that object is always either null or an object reference (i.e., of type O).

Verifiability:

There are no additional verification requirements.