We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assembly.GetExecutingAssembly()返回了错误的assembly,看文档说是IL2CPP的bug。但是我测试了在AOT中调用是正常的:
Assembly.GetExecutingAssembly()
assembly
string TestInMain() { return Assembly.GetExecutingAssembly().FullName; }
生成的C++代码:
// System.String LoadDll::TestInMain() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* LoadDll_TestInMain_m453A6AE1AE65CDB8E6502B9C4C6E71559A18B7D9 (LoadDll_tF4302664700CA4FCBC0471B8C95631AE6442BC68 * __this, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&LoadDll_TestInMain_m453A6AE1AE65CDB8E6502B9C4C6E71559A18B7D9_RuntimeMethod_var); s_Il2CppMethodInitialized = true; } { // return Assembly.GetExecutingAssembly().FullName; Assembly_t * L_0; L_0 = il2cpp_codegen_get_executing_assembly(LoadDll_TestInMain_m453A6AE1AE65CDB8E6502B9C4C6E71559A18B7D9_RuntimeMethod_var); NullCheck(L_0); String_t* L_1; L_1 = VirtFuncInvoker0< String_t* >::Invoke(12 /* System.String System.Reflection.Assembly::get_FullName() */, L_0); return L_1; } }
看起来IL2CPP做了特殊处理,并不会去调用Assembly.GetExecutingAssembly()生成的C++函数Assembly_GetExecutingAssembly_m990AB6145F5E80CC3CC8912043DC18497C2369EB。
Assembly_GetExecutingAssembly_m990AB6145F5E80CC3CC8912043DC18497C2369EB
// System.Reflection.Assembly System.Reflection.Assembly::GetExecutingAssembly() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Assembly_t * Assembly_GetExecutingAssembly_m990AB6145F5E80CC3CC8912043DC18497C2369EB (const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Assembly_GetExecutingAssembly_m990AB6145F5E80CC3CC8912043DC18497C2369EB_RuntimeMethod_var); s_Il2CppMethodInitialized = true; } return il2cpp_codegen_get_executing_assembly(Assembly_GetExecutingAssembly_m990AB6145F5E80CC3CC8912043DC18497C2369EB_RuntimeMethod_var); }
HybridCLR的解释版本执行之所以有问题,就是因为调用了这个函数。
是否考虑做下特殊处理解决这个问题?比如新增一个InstinctInstrument,专门用于处理Assembly.GetExecutingAssembly()
The text was updated successfully, but these errors were encountered:
合理,我们马上修复它。
Sorry, something went wrong.
感谢,已解决。需要手动安装最新hybridclr代码。
No branches or pull requests
环境
问题
Assembly.GetExecutingAssembly()
返回了错误的assembly
,看文档说是IL2CPP的bug。但是我测试了在AOT中调用是正常的:生成的C++代码:
看起来IL2CPP做了特殊处理,并不会去调用
Assembly.GetExecutingAssembly()
生成的C++函数Assembly_GetExecutingAssembly_m990AB6145F5E80CC3CC8912043DC18497C2369EB
。HybridCLR的解释版本执行之所以有问题,就是因为调用了这个函数。
是否考虑做下特殊处理解决这个问题?比如新增一个InstinctInstrument,专门用于处理
Assembly.GetExecutingAssembly()
The text was updated successfully, but these errors were encountered: