Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
短路评估如何在 msil 解释器中工作?And 指令是否包含有关如果为 false 时跳转到何处的信息,并且对于 OR 和 true 是否相同?
否 - And 和 Or 的 IL 指令实际上对堆栈顶部的两个操作数执行按位运算。如果高级语言使用短路评估,它会被编译为 IL 级别的显式分支操作,根本不依赖 And 指令。使用 Reflector 之类的工具来查看相关编译器生成的实际 IL。