Skip to content

Commit d81289b

Browse files
authored
Merge pull request #1004 from Unity-Technologies/unity-master-fix-il2cpp
Fix IL2CPP on Mono build.
2 parents 910eea6 + 448f290 commit d81289b

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

mono/metadata/unity-utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include <mono/utils/mono-string.h>
3232

3333
#if HAVE_BDWGC_GC
34-
#include <external/bdwgc/include/gc.h>
34+
#include <mono/utils/gc_wrapper.h>
3535
#endif
3636

3737
#include <glib.h>

mono/mini/debugger-agent.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10262,8 +10262,16 @@ static void GetExecutionContextAndHeaderInfo(MonoMethod* method, uint32_t* execu
1026210262
if (il2cpp_mono_methods_match(il2cpp_get_seq_point_method(seqPoint), method))
1026310263
{
1026410264
Il2CppMethodExecutionContextInfoIndex *index = &g_il2cpp_metadata->methodExecutionContextInfoIndexes[seqPoint->methodIndex];
10265-
*executionContextInfoCount = index->count;
10266-
*executionContextInfo = &g_il2cpp_metadata->methodExecutionContextInfos[index->tableIndex][index->startIndex];
10265+
if (index->count != -1)
10266+
{
10267+
*executionContextInfoCount = index->count;
10268+
*executionContextInfo = &g_il2cpp_metadata->methodExecutionContextInfos[index->tableIndex][index->startIndex];
10269+
}
10270+
else
10271+
{
10272+
*executionContextInfoCount = 0;
10273+
*executionContextInfo = NULL;
10274+
}
1026710275
*headerInfo = &g_il2cpp_metadata->methodHeaderInfos[seqPoint->methodIndex];
1026810276
*scopes = &g_il2cpp_metadata->methodScopes[(*headerInfo)->startScope];
1026910277
return;
@@ -10528,7 +10536,7 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g
1052810536
g_free (locals_map);
1052910537
#else
1053010538
uint32_t executionInfoCount, localVariableCount = 0, i;
10531-
const Il2CppMethodExecutionContextInfo* executionContextInfo;
10539+
const Il2CppMethodExecutionContextInfo* executionContextInfo = NULL;
1053210540
const Il2CppMethodHeaderInfo* headerInfo;
1053310541
const Il2CppMethodScope* scopes;
1053410542

0 commit comments

Comments
 (0)