Tencent / InjectFix

InjectFix is a hot-fix solution library for Unity
Other
1.97k stars 418 forks source link

子类方法里调用父类报错 #65

Open yy1985710 opened 4 years ago

yy1985710 commented 4 years ago

[IFix.Patch] protected override void SetupModel(LoginView view, LoginModel model) { base.SetupModel(view, model); Debug.Log("LoginViewModel Hotfix!!"); for (int i = 0; i < versionService.NewGameVersion.Version.Count; i++) { if (versionService.NewGameVersion.Version[i].GameName == VersionConst.App) { view.VersionsText.text = versionService.NewGameVersion.Version[i].Version; break; } } }

报错 create thread stack StackOverflowException: The requested operation caused a stack overflow. at IFix.Core.VirtualMachine.Execute (IFix.Core.Instruction pc, IFix.Core.Value argumentBase, System.Object[] managedStack, IFix.Core.Value* evaluationStackBase, System.Int32 argsCount, System.Int32 methodIndex, System.Int32 refCount, IFix.Core.Value topWriteBack) [0x055de] in :0 at IFix.Core.VirtualMachine.Execute (System.Int32 methodIndex, IFix.Core.Call& call, System.Int32 argsCount, System.Int32 refCount) [0x00000] in :0 at IFix.ILFixDynamicMethodWrapper.Gen_Wrap_250 (System.Object P0, System.Object P1, System.Object P2) [0x00037] in :0 at HardMan.Game.Login.UI.LoginViewModel.SetupModel (HardMan.Game.Login.UI.LoginView view, HardMan.Game.Login.UI.LoginModel model) [0x00019] in :0 at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <437ba245d8404784b9fbab9b439ac908>:0 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <437ba245d8404784b9fbab9b439ac908>:0 at IFix.Core.ReflectionMethodInvoker.Invoke (IFix.Core.VirtualMachine virtualMachine, IFix.Core.Call& call, System.Boolean isInstantiate) [0x0012a] in :0 at IFix.Core.VirtualMachine.Execute (IFix.Core.Instruction pc, IFix.Core.Value argumentBase, System.Object[] managedStack, IFix.Core.Value* evaluationStackBase, System.Int32 argsCount, System.Int32 methodIndex, System.Int32 refCount, IFix.Core.Value** topWriteBack) [0x0067f] in :0 at IFix.Core.VirtualMachine.Execute (System.Int32 methodIndex, IFix.Core.Call& call, System.Int32 argsCount, System.Int32 refCount) [0x00000] in :0 at IFix.ILFixDynamicMethodWrapper.Gen_Wrap_250 (System.Object P0, System.Object P1, System.Object P2) [0x00037] in :0 at HardMan.Game.Login.UI.LoginViewModel.SetupModel (HardMan.Game.Login.UI.LoginView view, HardMan.Game.Login.UI.LoginModel model) [0x00019] in :0 at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <437ba245d8404784b9fbab9b439ac908>:0 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <437ba245d8404784b9fbab9b439ac908>:0 at IFix.Core.ReflectionMethodInvoker.Invoke (IFix.Core.VirtualMachine virtualMachine, IFix.Core.Call& call, System.Boolean isInstantiate) [0x0012a] in :0 at IFix.Core.VirtualMachine.Execute (IFix.Core.Instruction pc, IFix.Core.Value argumentBase, System.Object[] managedStack, IFix.Core.Value* evaluationStackBase, System.Int32 argsCount, System.Int32 methodIndex, System.Int32 refCount, IFix.Core.Value topWriteBack) [0x0067f] in :0 at IFix.Core.VirtualMachine.Execute (System.Int32 methodIndex, IFix.Core.Call& call, System.Int32 argsCount, System.Int32 refCount) [0x00000] in :0 at IFix.ILFixDynamicMethodWrapper.__Gen_Wrap_250 (System.Object P0, System.Object P1, System.Object P2) [0x00037] in :0 at HardMan.Game.Login.UI.LoginViewModel.SetupModel (HardMan.Game.Login.UI.LoginView view, HardMan.Game.Login.UI.LoginModel model) [0x00019] in :0 现在时不支持子类调用父类吗?

chexiongsheng commented 4 years ago

父类函数是不是泛型的?看和这个类似不? https://github.com/Tencent/InjectFix/issues/23

yy1985710 commented 4 years ago

哦,对是这种情况,父类是泛型函数。所以不支持是吗?有打算支持吗?

chexiongsheng notifications@github.com 于2019年12月29日周日 下午3:58写道:

父类函数是不是泛型的?看和这个类似不?

23 https://github.com/Tencent/InjectFix/issues/23

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Tencent/InjectFix/issues/65?email_source=notifications&email_token=AAHQXMPIAEZGDQY6HI3AJZTQ3BKDJA5CNFSM4J7LPWDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHY2DYY#issuecomment-569483747, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHQXMKL3GFTGAKSQGCVXODQ3BKDJANCNFSM4J7LPWDA .

chexiongsheng commented 4 years ago

https://github.com/Tencent/InjectFix/issues/23 这里不是说了么?原来就支持,特意禁用掉,因为这个会导致某些版本的unity 打包时,il2cpp程序crash。