Format | Assembly Format | Description |
---|---|---|
FE 15 <T> | initobj typeTok |
Initialize the value at address dest. |
…, dest → …,
The initobj
instruction initializes an address with a default value. typeTok is a metadata token (a typedef
, typeref
, or typespec
). dest is an unmanaged pointer (native int
), or a managed pointer (&
). If typeTok is a value type, the initobj
instruction initializes each field of dest to null or a zero of the appropriate built-in type. If typeTok is a value type, then after this instruction is executed, the instance is ready for a constructor method to be called. If typeTok is a reference type, the initobj
instruction has the same effect as ldnull
followed by stind.ref
.
Unlike newobj
, the initobj
instruction does not call any constructor method.
None.
typeTok shall be a valid typedef
, typeref
, or typespec
metadata token.
The type of the destination value on top of the stack shall be a managed pointer to some type destType, and typeTok shall be assignable-to destType. If typeTok is a non-reference type, the definition of subtyping implies that destType and typeTok shall be equal.