InjectFix icon indicating copy to clipboard operation
InjectFix copied to clipboard

返回值为枚举的数组的函数,打补丁在运行时调用的时候报错Invalid IL code

Open Alan-Ben opened this issue 4 years ago • 1 comments

报错信息如下: System.InvalidProgramException: Invalid IL code in IFix.ILFixDynamicMethodWrapper:__Gen_Wrap_735 (object): IL_004f: ret
at MG.PlayerBreakIceGiftComponent.get_testdependCompList () [0x00019] in :0

最小测试示例 public enum MyEnumTest { Test, My, Ben, }

public class PlayerBreakIceGiftComponent : _ANPBasicPlayerComponent
{
    public MyEnumTest[] testEnumArrayt
    {
        get
        {
            return null;
        }
    }

    public PlayerBreakIceGiftComponent()
    {
            var kk = testEnumArrayt;
    }

}

测试环境:pc mono打包

Alan-Ben avatar Feb 22 '21 07:02 Alan-Ben

我最新版本试了没问题,你这个是不是版本太老的原因呢?

chexiongsheng avatar Mar 19 '21 08:03 chexiongsheng