il2cpp code generation issue

Hello everyone,

I’m using Unity 5.1.1p4 and have been having an issue, building for iOS (SDK 8) in a il2cpp instruction on the XCode project.

Every time I make a build, the il2cpp generates this code, in the file Build_Generics_4.cpp:

NullCheck((AmazonServiceException_t400 *)(*(&V_5)));
AmazonServiceException_set_StatusCode_m2109((AmazonServiceException_t400 *)(*(&V_5)), (int32_t)L_55, /*hidden argument*/NULL);
Object_t * L_56 = V_5;
il2cpp_codegen_raise_exception(L_56);

But by definition the method il2cpp_codegen_raise_exception has this signature:

il2cpp_codegen_raise_exception (Il2CppCodeGenException *ex)

and Il2CppCodeGenException expects a string type as input.

So every time, as a workaround, I have to convert the L_56, an integer, to string…

std::stringstream ss;
ss << L_56;
std::string str;
ss >> str;
il2cpp_codegen_raise_exception(il2cpp_codegen_get_not_supported_exception(str.c_str()));

Do anyone have an idea of whats causing this. This looks like a il2cpp bug.

Thank you in advance

Yes this is a known bug in IL2CPP. It will be corrected in 5.1.2p1, which should be available this week.