Skip to content

Commit

Permalink
Fix crash in mono_resolve_patch_target_ext when method is NULL. (dotn…
Browse files Browse the repository at this point in the history
  • Loading branch information
lateralusX committed May 5, 2021
1 parent 65020c9 commit 498551a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mono/mono/mini/mini-runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -1429,11 +1429,11 @@ mono_resolve_patch_target_ext (MonoMemoryManager *mem_manager, MonoMethod *metho
if (method && method->dynamic) {
jump_table = (void **)mono_code_manager_reserve (mono_dynamic_code_hash_lookup (method)->code_mp, sizeof (gpointer) * patch_info->data.table->table_size);
} else {
MonoMemoryManager *mem_manager = m_method_get_mem_manager (method);
MonoMemoryManager *method_mem_manager = method ? m_method_get_mem_manager (method) : mem_manager;
if (mono_aot_only) {
jump_table = (void **)mono_mem_manager_alloc (mem_manager, sizeof (gpointer) * patch_info->data.table->table_size);
jump_table = (void **)mono_mem_manager_alloc (method_mem_manager, sizeof (gpointer) * patch_info->data.table->table_size);
} else {
jump_table = (void **)mono_mem_manager_code_reserve (mem_manager, sizeof (gpointer) * patch_info->data.table->table_size);
jump_table = (void **)mono_mem_manager_code_reserve (method_mem_manager, sizeof (gpointer) * patch_info->data.table->table_size);
}
}

Expand Down

0 comments on commit 498551a

Please sign in to comment.