File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,12 @@ internal static void InitCaches()
4747 PrimitiveTypeCache [ e ]  =  LibCpp2IlMain . Binary ! . AllTypes . First ( t =>  t . Type  ==  e  &&  t . Byref  ==  0 ) ; 
4848 } 
4949
50-  PrimitiveTypeCache [ Il2CppTypeEnum . IL2CPP_TYPE_TYPEDBYREF ]  =  LibCpp2IlMain . Binary ! . AllTypes . First ( t =>  t . Type  ==  Il2CppTypeEnum . IL2CPP_TYPE_TYPEDBYREF  &&  t . Byref  ==  0 ) ; 
50+  PrimitiveTypeCache [ Il2CppTypeEnum . IL2CPP_TYPE_TYPEDBYREF ]  =  LibCpp2IlMain . Binary ! . AllTypes . FirstOrDefault ( t =>  t . Type  ==  Il2CppTypeEnum . IL2CPP_TYPE_TYPEDBYREF  &&  t . Byref  ==  0 ) 
51+  ??  LibCpp2IlMain . TheMetadata ! . typeDefs . First ( t =>  t . DeclaringAssembly ? . Name  is  "mscorlib.dll"  &&  t . Namespace  is  "System"  &&  t . Name  is  "TypedReference" ) . RawType ; 
52+  // Sometimes, TypedReference does not have IL2CPP_TYPE_TYPEDBYREF as its type, but instead has IL2CPP_TYPE_VALUETYPE. 
53+  // In this case, we need to get the type from the metadata instead of the binary. 
54+  // https://github.com/SamboyCoding/Cpp2IL/issues/445 
55+ 
5156 for  ( var  e  =  Il2CppTypeEnum . IL2CPP_TYPE_I ;  e  <=  Il2CppTypeEnum . IL2CPP_TYPE_U ;  e ++ ) 
5257 { 
5358 PrimitiveTypeCache [ e ]  =  LibCpp2IlMain . Binary ! . AllTypes . First ( t =>  t . Type  ==  e  &&  t . Byref  ==  0 ) ; 
                         You can’t perform that action at this time. 
           
                  
0 commit comments