OpCodes.Ldnull 字段


将空引用(O 类型)推送到计算堆栈上。Pushes a null reference (type O) onto the evaluation stack.

public: static initonly System::Reflection::Emit::OpCode Ldnull;
public static readonly System.Reflection.Emit.OpCode Ldnull;
 staticval mutable Ldnull : System.Reflection.Emit.OpCode
Public Shared ReadOnly Ldnull As OpCode 



下表列出了指令的十六进制和 Microsoft 中间语言(MSIL)程序集格式以及简短的参考摘要:The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

格式Format 程序集格式Assembly Format 说明Description
1414 ldnullldnull 在堆栈上推送空引用push a null reference onto the stack

堆栈转换行为顺序如下:The stack transitional behavior, in sequential order, is:

  1. 空对象引用被推送到堆栈上。A null object reference is pushed onto the stack.

@no__t 在堆栈上推送空引用(类型 O)。ldnull pushes a null reference (type O) on the stack. 这用于在使用数据填充位置之前或在位置被弃用时初始化位置。This is used to initialize locations before they are populated with data, or when they become deprecated.

ldnull 提供一个与大小无关的空引用。ldnull provides a null reference that is size-independent.

以下 @no__t 0 方法重载可以使用 @no__t 操作码:The following Emit method overload can use the ldnull opcode:

  • ILGenerator.Emit(OpCode)ILGenerator.Emit(OpCode)