gpt4 book ai didi

c# - IL 指令 "cpobj"是否适用于引用类型?

转载 作者:行者123 更新时间:2023-12-05 05:45:35 26 4
gpt4 key购买 nike

Microsoft Docs说:

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 已过时。

关于c# - IL 指令 "cpobj"是否适用于引用类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71322625/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com