Skip to content

Commit

Permalink
[interp] Add method to seq_points table after we finish registering it
Browse files Browse the repository at this point in the history
When adding a breakpoint (mono_de_set_breakpoint) we search in this table for seq_point information for the method. If we find the information we expect that the method is already compiled and has the metadata initialized when actually adding the breakpoint (set_bp_in_method). We were crashing if the jinfo field of the interp method was not yet initialized.

Fixes xamarin/xamarin-macios#5381
  • Loading branch information
BrzVlad authored and monojenkins committed Feb 8, 2019
1 parent a13ca00 commit 1b6a528
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions mono/mini/interp/transform.c
Original file line number Diff line number Diff line change
Expand Up @@ -2011,10 +2011,6 @@ save_seq_points (TransformData *td, MonoJitInfo *jinfo)

g_byte_array_free (array, TRUE);

mono_domain_lock (domain);
g_hash_table_insert (domain_jit_info (domain)->seq_points, rtm->method, info);
mono_domain_unlock (domain);

jinfo->seq_points = info;
}

Expand Down Expand Up @@ -5336,7 +5332,13 @@ mono_interp_transform_method (InterpMethod *imethod, ThreadContext *context, Mon
mono_memory_barrier ();
imethod->transformed = TRUE;
mono_atomic_fetch_add_i32 (&mono_jit_stats.methods_with_interp, 1);

}
mono_os_mutex_unlock (&calc_section);

mono_domain_lock (domain);
if (!g_hash_table_lookup (domain_jit_info (domain)->seq_points, imethod->method))
g_hash_table_insert (domain_jit_info (domain)->seq_points, imethod->method, imethod->jinfo->seq_points);
mono_domain_unlock (domain);
}

0 comments on commit 1b6a528

Please sign in to comment.