Skip to content

Latest commit

 

History

History
31 lines (17 loc) · 1.6 KB

iii.4.14-ldsfld.md

File metadata and controls

31 lines (17 loc) · 1.6 KB

III.4.14 ldsfld – load static field of a class

Format Assembly Format Description
7E <T> ldsfld field Push the value of field on the stack.

Stack Transition:

…, → …, value

Description:

The ldsfld instruction pushes the value of a static (shared among all instances of a class) field on the stack. field is a metadata token (a fieldref or fielddef; see Partition II) referring to a static field member. The return type is that associated with field.

The ldsfld instruction can have a volatile. prefix. If required field values are converted to the representation of their intermediate typeI.8.7) when loaded onto the stack (§III.1.1.1).

[Note: That is field values that are smaller than 4 bytes, a boolean or a character are converted to 4 bytes by sign or zero-extension as appropriate. Floating-point values are converted to their native size (type F). end note]

Exceptions:

System.FieldAccessException is thrown if field is not accessible.

System.MissingFieldException is thrown if field is not found in the metadata. This is typically checked when CIL is converted to native code, not at runtime.

Correctness:

Correct CIL ensures that field is a valid metadata token referring to a static field member.

Verifiability:

Verification tracks the type of the value on the stack as the intermediate typeI.8.7) of the field type.