IL 指令 "cpobj" 是否适用于引用类型?
Is IL instruction "cpobj" applicable for reference types?
The behavior of cpobj is unspecified if ……, or if classTok does not represent a value type.
但是 ECMA 335 说:
If typeTok is a reference type, the cpobj instruction has the same effect as ldind.ref followed by stind.ref.
哪个是正确的?
如果我们查看 ECMA-335 之前的版本,我们会发现第 3 版更改了措辞以指定:
If typeTok is a reference type, the cpobj instruction has the same effect as ldind.ref followed by stind.ref.
第 1 版和第 2 版中的措辞与 MSDN 上的一致。
因此,我认为可以肯定地说 ECMA-335 第 6 版是正确的,而 MSDN 已过时。
The behavior of cpobj is unspecified if ……, or if classTok does not represent a value type.
但是 ECMA 335 说:
If typeTok is a reference type, the cpobj instruction has the same effect as ldind.ref followed by stind.ref.
哪个是正确的?
如果我们查看 ECMA-335 之前的版本,我们会发现第 3 版更改了措辞以指定:
If typeTok is a reference type, the cpobj instruction has the same effect as ldind.ref followed by stind.ref.
第 1 版和第 2 版中的措辞与 MSDN 上的一致。
因此,我认为可以肯定地说 ECMA-335 第 6 版是正确的,而 MSDN 已过时。