Search Issue Tracker
Fixed in 2022.1.X
Fixed in 2021.2.X
Votes
0
Found in
Issue ID
1354855
Regression
Yes
IL2CPP fails code conversion for Enum.HasFlag case
IL2CPP fails to convert correct IL code that use an enum cast to an object
C:/UnityProjects/EMERGE_Home_Kopie/Library/Bee/artifacts/Android/il2cppOutput/cpp/ThirdParty.cpp:1:
In file included from C:/Program Files/Unity/Hub/Editor/2021.2.0b4/Editor/Data/il2cpp/libil2cpp/pch\pch-cpp.hpp:6:
In file included from C:/Program Files\Unity\Hub\Editor\2021.2.0b4\Editor\Data\il2cpp\libil2cpp\codegen\il2cpp-codegen.h:10:
C:\Program Files\Unity\Hub\Editor\2021.2.0b4\Editor\Data\il2cpp\libil2cpp\codegen\il2cpp-codegen-il2cpp.h(402,23): error: invalid operands to binary expression ('Enum_t2A1A94B24E3B776EEF4E5E485E290BB9D4D072E2 *' and 'Enum_t2A1A94B24E3B776EEF4E5E485E290BB9D4D072E2 *')
return (enumValue & flag) == flag;
~~~~~~~~~ ^ ~~~~
C:\UnityProjects\EMERGE_Home_Kopie\Library\Bee\artifacts\Android\il2cppOutput\cpp\ThirdParty.cpp(7175,14): note: in instantiation of function template specialization 'il2cpp_codegen_enum_has_flag<Enum_t2A1A94B24E3B776EEF4E5E485E290BB9D4D072E2 *>' requested here
bool L_4 = il2cpp_codegen_enum_has_flag(((Enum_t2A1A94B24E3B776EEF4E5E485E290BB9D4D072E2*)CastclassClass((RuntimeObject*)L_1, Enum_t2A1A94B24E3B776EEF4E5E485E290BB9D4D072E2_il2cpp_TypeInfo_var)), ((Enum_t2A1A94B24E3B776EEF4E5E485E290BB9D4D072E2*)CastclassClass((RuntimeObject*)L_3, Enum_t2A1A94B24E3B776EEF4E5E485E290BB9D4D072E2_il2cpp_TypeInfo_var)));
^
1 error generated.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- "Unexpected exception System.DllNotFoundException" error thrown in the Console window when creating a project with 2D (URP) Template
- [Backport] [XR SDK] [HDRP] XRSettings.gameViewRenderMode does not change Game View Render Mode
- [Backport] [Android][Vulkan] Crash on Samsung Note8 while running gfx tests
- [Backport] Wrong sorting for "GC Alloc" column in Show Related Objects panel of Profiler Window
- [Backport] [iOS] Unfreed allocation errors thrown in Console when executing Build And Run with iOS platform
Add comment