OpCodes.Add_Ovf 字段  
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将两个整数相加,执行溢出检查,并且将结果推送到计算堆栈上。
public: static initonly System::Reflection::Emit::OpCode Add_Ovf;public static readonly System.Reflection.Emit.OpCode Add_Ovf; staticval mutable Add_Ovf : System.Reflection.Emit.OpCodePublic Shared ReadOnly Add_Ovf As OpCode 字段值
注解
下表列出了指令的十六进制和 Microsoft 中间语言 (MSIL) 程序集格式,以及简短的参考摘要:
| 格式 | 程序集格式 | 说明 | 
|---|---|---|
| D6 | add.ovf | 使用溢出检查添加两个有符号整数值。 | 
堆栈过渡行为(按顺序排列)为:
- value1被推送到堆栈上。
- value2被推送到堆栈上。
- value2和- value1从堆栈中弹出;- value1- value2添加到 时带有溢出检查。
- 结果将推送到堆栈上。 
OverflowException 如果结果未在结果类型中表示,则引发 。
可以对有符号整数执行此操作。 对于浮点值,请使用 Add。
下表中列出了可接受的操作数类型及其相应的结果数据类型。 如果特定类型组合没有条目 (例如 int32 和 float; int32) int64 ,则它是无效的 Microsoft 中间语言 (MSIL) 指令并生成错误。
| 操作数 | value1 类型 | value2 类型 | 结果类型 | 
|---|---|---|---|
| add | int32 | int32 | int32 | 
| add | int32 | native int | native int | 
| add | int32 | & | & | 
| add | int32 | * | * | 
| add | int64 | int64 | int64 | 
| add | native int | int32 | native int | 
| add | native int | native int | native int | 
| add | native int | & | & | 
| add | native int | * | * | 
| add | F | F | F | 
| add | & | int32 | & | 
| add | & | native int | & | 
| add | * | int32 | * | 
| add | * | native int | * | 
以下 Emit 方法重载可以使用 add.ovf opcode: